public class HttpServletRequestUtils extends Object
| Constructor and Description |
|---|
HttpServletRequestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static URL |
getCurrentURL(javax.servlet.http.HttpServletRequest httpServletRequest)
[EXPERIMENTAL] Get the URL for current HTTP request.
|
static URI |
uriFor(javax.servlet.http.HttpServletRequest httpServletRequest,
String path,
Map<String,String> parameters)
[EXPERIMENTAL] Constructs an absolute URI object based on the application root, the provided path, and the additional arguments and query parameters provided.
|
static URI |
uriWith(javax.servlet.http.HttpServletRequest httpServletRequest,
Map<String,String> parameters)
[EXPERIMENTAL] Returns a rewritten URI object for the current request.
|
public static URL getCurrentURL(@NonNull javax.servlet.http.HttpServletRequest httpServletRequest) throws MalformedURLException
MalformedURLExceptionpublic static URI uriFor(@NonNull javax.servlet.http.HttpServletRequest httpServletRequest, @NonNull String path, @NonNull Map<String,String> parameters) throws URISyntaxException, MalformedURLException
http://example.com/xxx/,
uriFor("/x") returns http://example.com/xxx/xhttpServletRequest - instance of HttpServletRequest.path - Path from the current URL. You can use root relative URL from context root.parameters - Query parameters.URISyntaxExceptionMalformedURLExceptionpublic static URI uriWith(@NonNull javax.servlet.http.HttpServletRequest httpServletRequest, Map<String,String> parameters) throws URISyntaxException, MalformedURLException
httpServletRequest - instance of HttpServletRequest.parameters - Query parameters.URISyntaxExceptionMalformedURLExceptionCopyright © 2015. All rights reserved.