public String getPath() { return request.getPath(); }
public boolean dispatch(Request request, Response response) throws IOException { String path = request.getPath(); if (!path.startsWith(pathPrefix)) return false; String virtualPath = path.substring(pathPrefix.length()+1); return jsHandler.handleRequest(virtualPath,response); }
protected final void train_getPath(Request request, String path) { expect(request.getPath()).andReturn(path).atLeastOnce(); }
public boolean dispatch(Request request, Response response) throws IOException { String path = request.getPath(); if (path.startsWith(requestPrefix)) { String extraPath = path.substring(requestPrefix.length()); Locale locale = request.getLocale(); if (!handleModuleRequest(locale, extraPath, response)) { response.sendError(HttpServletResponse.SC_NOT_FOUND, String.format("No module for path '%s'.", extraPath)); } return true; } return false; }
public boolean dispatch(Request request, Response response) throws IOException String path = request.getPath();
public boolean dispatch(Request request, final Response response) throws IOException { // Only match the root path if (request.getPath().equals("/") && componentClassResolver.isPageName(startPageName)) { localizationSetter.setNonPersistentLocaleFromLocaleName(request.getLocale().toString()); handler.handlePageRender(parameters); return true; } return false; }
public boolean service(Request request, Response response, RequestHandler handler) throws IOException String path = request.getPath();
public boolean service(Request request, Response response, RequestHandler handler) throws IOException { long startTime = System.nanoTime(); try { return handler.service(request, response); } finally { long elapsed = System.nanoTime() - startTime; log.info(String.format("Request time: %5.2f s -- %s", elapsed * 10E-10d, request.getPath())); } } };
String path = request.getPath();
String requestPath = request.getPath();
@Test public void get_path_for_normal_servlet_container() { String path = "/foo/bar"; HttpServletRequest sr = mockHttpServletRequest(); train_getPathInfo(sr, null); expect(sr.getServletPath()).andReturn(path); replay(); Request request = new RequestImpl(sr, CHARSET, null); assertEquals(request.getPath(), path); verify(); }
pw.write("path", request.getPath()); pw.write("locale", request.getLocale()); pw.write("serverName", request.getServerName());
public PageRenderRequestParameters decodePageRenderRequest(Request request) { String path = request.getPath(); String[] split = path.substring(1).split("/"); if (split.length == 1 && split[0].equals("")) return null; int pacx = 0; String possibleLocaleName = split[0]; // Might be just the page activation context, or it might be locale then page // activation context boolean localeSpecified = localizationSetter.isSupportedLocaleName(possibleLocaleName); if (localeSpecified) { pacx++; } if (pacx >= split.length) return null; if (localeSpecified) localizationSetter.setLocaleFromLocaleName(possibleLocaleName); boolean isLoopback = request.getParameter(TapestryConstants.PAGE_LOOPBACK_PARAMETER_NAME) != null; return new PageRenderRequestParameters("View", new ArrayEventContext(typeCoercer, split[pacx]), isLoopback); }
dt(writer, "Path", request.getPath());
/** * TAPESTRY-1713 */ @Test public void get_path_for_websphere_with_nonempty_path() { HttpServletRequest sr = mockHttpServletRequest(); train_getPathInfo(sr, ""); replay(); Request request = new RequestImpl(sr, CHARSET, null); assertEquals(request.getPath(), "/"); verify(); }
/** * TAPESTRY-1713 */ @Test public void get_path_for_websphere_with_empty_path() { String path = "/foo/bar"; HttpServletRequest sr = mockHttpServletRequest(); train_getPathInfo(sr, path); replay(); Request request = new RequestImpl(sr, CHARSET, null); assertEquals(request.getPath(), path); verify(); }
public ComponentEventRequestParameters decodeComponentEventRequest(Request request) { if (!request.getPath().equals("/event")) return null; String localeName = request.getParameter("x:locale"); String pageName = request.getParameter("x:page"); String container = request.getParameter("x:container"); String id = request.getParameter("x:id"); String pac = request.getParameter("x:pac"); String ec = request.getParameter("x:ec"); String type = request.getParameter("x:type"); if (localeName != null) localizationSetter.setLocaleFromLocaleName(localeName); return new ComponentEventRequestParameters(pageName, container == null ? pageName : container, id, type, toContext(pac), toContext(ec)); }