List of usage examples for javax.servlet.http HttpServletRequest getPathInfo
public String getPathInfo();
From source file:uk.ac.ox.oucs.vle.mvc.PathInfoHelper.java
/** * Sakai wrapper around request returns pathInfo of null * which breaks spring mvc//w w w .j a va2s.c om */ @Override public String getLookupPathForRequest(HttpServletRequest request) { String lookup = request.getPathInfo(); if (lookup == null) lookup = "/"; return lookup; }
From source file:org.dspace.app.webui.cris.controller.RedirectFromUUIDtoDetailsController.java
private String extractUUID(HttpServletRequest request) { String path = request.getPathInfo().substring(1); // remove first / String[] splitted = path.split("/"); return splitted[splitted.length - 1]; }
From source file:com.silverpeas.directory.servlets.ImageDisplay.java
protected String getAvatar(HttpServletRequest req) { int position = req.getPathInfo().indexOf('/'); return req.getPathInfo().substring(position + 1); }
From source file:com.thoughtworks.go.server.websocket.ConsoleLogSocketServlet.java
private String pipeline(HttpServletRequest request) { return request.getPathInfo().split("/")[1]; }
From source file:org.uaa.security.core.LoggerManager.java
public void logBefore(HttpServletRequest request) { res_uri = request.getPathInfo(); if (res_uri.startsWith("/logs")) return;//from ww w . j a v a 2s . c o m String res_action = request.getMethod(); request_time = new Timestamp(System.currentTimeMillis()); String addr = request.getRemoteAddr(); String client = request.getHeader("User-Agent"); log = new Apilog(); log.setAddr(addr); log.setClient(client); log.setRequest_time(request_time.getTime()); log.setRes_action(res_action); log.setRes_uri(res_uri); securityService.insertLog(log); }
From source file:com.springsource.hq.plugin.tcserver.serverconfig.web.support.ReadOnlyHandlerInterceptor.java
private String parseeid(HttpServletRequest request) { String pathInfo = request.getPathInfo(); if (pathInfo == null) { return null; }/*w w w .ja v a 2 s. co m*/ int eidStart = pathInfo.indexOf("/"); int eidEnd = pathInfo.indexOf("/", eidStart + 1); if (eidEnd == -1) { return null; } return pathInfo.substring(eidStart + 1, eidEnd); }
From source file:cn.bc.web.util.WebUtils.java
/** * ??? * //from w w w . j av a2 s .com * <pre> * http://www.demo.com/demo/test.htm --> /demo/test.htm</span> * </pre> * * @param request * @return ?/demo/test.htm */ public static String getResourcePath(HttpServletRequest request) { // Adapted from VelocityViewServlet.handleRequest() method: // If we get here from RequestDispatcher.include(), getServletPath() // will return the original (wrong) URI requested. The following // special attribute holds the correct path. See section 8.3 of the // Servlet 2.3 specification. String path = (String) request.getAttribute("javax.servlet.include.servlet_path"); // Also take into account the PathInfo stated on // SRV.4.4 Request Path Elements. String info = (String) request.getAttribute("javax.servlet.include.path_info"); if (path == null) { path = request.getServletPath(); info = request.getPathInfo(); } if (info != null) { path += info; } return path; }
From source file:photogift.server.filter.AuthenticatedFilter.java
private boolean noAuth(HttpServletRequest request) { String pathInfo = request.getPathInfo(); String method = request.getMethod(); return (pathInfo.startsWith("/giftchains") || (pathInfo.startsWith("/gifts/") && (method.equals("GET")))); }
From source file:org.italiangrid.storm.webdav.authz.util.CustomMethodAntPathRequestMatcher.java
private String getRequestPath(HttpServletRequest request) { String url = request.getServletPath(); if (request.getPathInfo() != null) { url += request.getPathInfo();//from w ww . j a v a 2 s .com } return url; }
From source file:org.openmhealth.dsu.controller.GenericExceptionHandlingControllerAdvice.java
@ExceptionHandler(Exception.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public void handleException(Exception e, HttpServletRequest request) { log.warn("A {} request for '{}' failed.", request.getMethod(), request.getPathInfo(), e); }