|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.util.HttpUtil
public class HttpUtil
Provides helper methods for working with HTTP requests and responses.
Method Summary | |
---|---|
static String |
getRequestedPath(HttpServletRequest request)
Get the path from the given request. |
static String |
getRequestedServletPath(HttpServletRequest request)
Get the servlet path of the current request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String getRequestedPath(HttpServletRequest request)
Get the path from the given request. This method is different from
HttpServletRequest.getRequestURI()
in that it concatenates and returns the servlet
path plus the path info from the request. These are usually the same, but in some cases they
are not.
One case where they are known to differ is when a request for a directory is forwarded by the
servlet container to a welcome file. In that case, HttpServletRequest.getRequestURI()
returns the path that was actually requested (e.g., "/"
), whereas the servlet path
plus path info is the path to the welcome file (e.g. "/index.jsp"
).
public static String getRequestedServletPath(HttpServletRequest request)
HttpServletRequest.getServletPath()
. If the given request is an include, then
the servlet path of the included resource is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |