From 6063259455ad0ef0ede183b3084d1eb89e1bcc1d Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 5 Feb 2008 10:56:50 +0000 Subject: [PATCH] * 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. --- src/helma/framework/RequestBean.java | 7 +++++++ src/helma/framework/RequestTrans.java | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/helma/framework/RequestBean.java b/src/helma/framework/RequestBean.java index 44ac9636..91d6cc23 100644 --- a/src/helma/framework/RequestBean.java +++ b/src/helma/framework/RequestBean.java @@ -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 */ diff --git a/src/helma/framework/RequestTrans.java b/src/helma/framework/RequestTrans.java index 4de88e5a..ae8f7b03 100644 --- a/src/helma/framework/RequestTrans.java +++ b/src/helma/framework/RequestTrans.java @@ -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. */