|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.web.util.UrlUtils
public final class UrlUtils
Provides static methods for composing URLs.
Placed into a separate class for visibility, so that changes to URL formatting conventions will affect all users.
Constructor Summary | |
---|---|
UrlUtils()
|
Method Summary | |
---|---|
static String |
buildFullRequestUrl(HttpServletRequest r)
|
static String |
buildFullRequestUrl(String scheme,
String serverName,
int serverPort,
String requestURI,
String queryString)
Obtains the full URL the client used to make the request. |
static String |
buildRequestUrl(HttpServletRequest r)
Obtains the web application-specific fragment of the request URL. |
static boolean |
isValidRedirectUrl(String url)
Returns true if the supplied URL starts with a "/" or "http". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UrlUtils()
Method Detail |
---|
public static String buildFullRequestUrl(HttpServletRequest r)
public static String buildFullRequestUrl(String scheme, String serverName, int serverPort, String requestURI, String queryString)
Note that the server port will not be shown if it is the default server port for HTTP or HTTPS (80 and 443 respectively).
public static String buildRequestUrl(HttpServletRequest r)
Under normal spec conditions,
requestURI = contextPath + servletPath + pathInfoBut the requestURI is not decoded, whereas the servletPath and pathInfo are (SEC-1255). This method is typically used to return a URL for matching against secured paths, hence the decoded form is used in preference to the requestURI for building the returned value. But this method may also be called using dummy request objects which just have the requestURI and contextPatth set, for example, so it will fall back to using those.
public static boolean isValidRedirectUrl(String url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |