/** * @return filter prefix */ public String getFilterPrefix() { return getServletPath().substring(1); }
/** * @return filter prefix */ public String getFilterPrefix() { return getServletPath().substring(1); }
/** * Returns context path and servlet path concatenated, typically * /applicationClassName/applicationClassName * * @return The path value * @see javax.servlet.http.HttpServletRequest#getRequestURI() */ @Override public String getRequestURI() { if (url == null) { return getContextPath() + getServletPath(); } else { int index = url.indexOf("?"); if (index != -1) { return url.substring(0, index); } } return url; }
/** * Returns context path and servlet path concatenated, typically * /applicationClassName/applicationClassName * * @return The path value * @see javax.servlet.http.HttpServletRequest#getRequestURI() */ @Override public String getRequestURI() { if (url == null) { return getContextPath() + getServletPath(); } else { int index = url.indexOf("?"); if (index != -1) { return url.substring(0, index); } } return url; }
String url = servletRequest.getServletPath(); final String pathInfo = servletRequest.getPathInfo();
/** * Simulates a request to a mounted {@link ResourceReference} * * @param reference * the resource reference to test * @param pageParameters * the parameters passed to the resource reference * @return the tested resource reference */ public ResourceReference startResourceReference(final ResourceReference reference, final PageParameters pageParameters) { // prepare request request.setURL(request.getContextPath() + request.getServletPath() + "/"); IRequestHandler handler = new ResourceReferenceRequestHandler(reference, pageParameters); // execute request processRequest(request, handler); // the reference processed return reference; }
/** * Simulates a request to a mounted {@link ResourceReference} * * @param reference * the resource reference to test * @param pageParameters * the parameters passed to the resource reference * @return the tested resource reference */ public ResourceReference startResourceReference(final ResourceReference reference, final PageParameters pageParameters) { // prepare request request.setURL(request.getContextPath() + request.getServletPath() + "/"); IRequestHandler handler = new ResourceReferenceRequestHandler(reference, pageParameters); // execute request processRequest(request, handler); // the reference processed return reference; }
path = getContextPath() + getServletPath() + '/' + path; if (path.startsWith(getServletPath())) path = path.substring(getServletPath().length());
path = getContextPath() + getServletPath() + '/' + path; if (path.startsWith(getServletPath())) path = path.substring(getServletPath().length());
/** * Renders the page specified by given {@link IPageProvider}. After render the page instance can * be retrieved using {@link #getLastRenderedPage()} and the rendered document will be available * in {@link #getLastResponse()}. * * Depending on {@link RenderStrategy} invoking this method can mean that a redirect will happen * before the actual render. * * @param pageProvider * @return last rendered page */ public Page startPage(final IPageProvider pageProvider) { // should be null for Pages componentInPage = null; // prepare request request.setURL(request.getContextPath() + request.getServletPath() + "/"); IRequestHandler handler = new RenderPageRequestHandler(pageProvider); // process request processRequest(request, handler); // The page rendered return getLastRenderedPage(); }
/** * Renders the page specified by given {@link IPageProvider}. After render the page instance can * be retrieved using {@link #getLastRenderedPage()} and the rendered document will be available * in {@link #getLastResponse()}. * * Depending on {@link RenderStrategy} invoking this method can mean that a redirect will happen * before the actual render. * * @param pageProvider * @return last rendered page */ public Page startPage(final IPageProvider pageProvider) { // should be null for Pages componentInPage = null; // prepare request request.setURL(request.getContextPath() + request.getServletPath() + "/"); IRequestHandler handler = new RenderPageRequestHandler(pageProvider); // process request processRequest(request, handler); // The page rendered return getLastRenderedPage(); }
private void setupNextRequestCycle() request.setURL(request.getContextPath() + request.getServletPath() + "/");
request.setURL(request.getContextPath() + request.getServletPath() + "/");