* Implement support for req.uri. This property contains the full request URI for
HTTP requests, and is null for internal requests. While req.path only contains the request's path info within the helma application, req.uri contains the request's full URI starting at the web server root.
This commit is contained in:
parent
b49ad9d2f1
commit
6063259455
2 changed files with 20 additions and 1 deletions
|
@ -188,6 +188,13 @@ public class RequestBean implements Serializable {
|
|||
return req.getPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the request URI
|
||||
*/
|
||||
public String getUri() {
|
||||
return req.getUri();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the username if using HTTP basic authentication
|
||||
*/
|
||||
|
|
|
@ -53,9 +53,12 @@ public class RequestTrans implements Serializable {
|
|||
final HttpServletRequest request;
|
||||
final HttpServletResponse response;
|
||||
|
||||
// the uri path of the request
|
||||
// the path info of the request
|
||||
private final String path;
|
||||
|
||||
// the uri of the request
|
||||
private final String uri;
|
||||
|
||||
// the request's session id
|
||||
private String session;
|
||||
|
||||
|
@ -90,6 +93,7 @@ public class RequestTrans implements Serializable {
|
|||
public RequestTrans(String method, String path) {
|
||||
this.method = method;
|
||||
this.path = path;
|
||||
this.uri = null;
|
||||
this.request = null;
|
||||
this.response = null;
|
||||
startTime = System.currentTimeMillis();
|
||||
|
@ -104,6 +108,7 @@ public class RequestTrans implements Serializable {
|
|||
this.request = request;
|
||||
this.response = response;
|
||||
this.path = path;
|
||||
this.uri = request.getRequestURI();
|
||||
startTime = System.currentTimeMillis();
|
||||
|
||||
// do standard HTTP variables
|
||||
|
@ -429,6 +434,13 @@ public class RequestTrans implements Serializable {
|
|||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the request's path
|
||||
*/
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the request's action.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue