public class RelativeRequestUri extends Object
| Request URI | Path Index | Relative URI |
|---|---|---|
| /a/b/c | 0 | /a/b/c |
| /a/b/c | 1 | /b/c |
| /a/b/c | 3 | (empty) |
| Constructor and Description |
|---|
RelativeRequestUri(javax.servlet.http.HttpServletRequest request,
int pathIndex)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getComponents()
Gets components of the uri.
|
String |
getLastComponent()
Gets the last component of request uri.
|
String |
getPrefix()
Gets the absolute path from the context root to the start of the uri.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the original HTTP request.
|
String |
getUri()
Gets the uri.
|
String |
toString() |
public RelativeRequestUri(javax.servlet.http.HttpServletRequest request,
int pathIndex)
request - HTTP requestpathIndex - index of the first path component relative to a servlet root (not
context root!). Path components are parts of the request uri
separated by '/' with the first component (servlet root) being
assigned index zero.IllegalArgumentException - if pathIndex is negativepublic javax.servlet.http.HttpServletRequest getRequest()
public String getPrefix()
public String getUri()
public String[] getComponents()
public String getLastComponent()
null if request is emptyCopyright © 2020 JBoss by Red Hat. All rights reserved.