You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2002/01/18 03:02:44 UTC
cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session HttpServletRequestFacade.java
dlr 02/01/17 18:02:44
Modified: src/java/org/apache/stratum/jcs/utils/servlet/session
HttpServletRequestFacade.java
Log:
Added a getRequestURL() instance method (using code borrow from
Catalina), step one of three for 2.3 compatibility for this class.
Revision Changes Path
1.5 +32 -0 jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/HttpServletRequestFacade.java
Index: HttpServletRequestFacade.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/HttpServletRequestFacade.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- HttpServletRequestFacade.java 16 Jan 2002 05:32:46 -0000 1.4
+++ HttpServletRequestFacade.java 18 Jan 2002 02:02:44 -0000 1.5
@@ -552,6 +552,38 @@
/**
+ * Gets the full request URL.
+ *
+ * @return A new buffer containing the reconstructed URL.
+ */
+ public StringBuffer getRequestURL()
+ {
+ // FUTURE: Delegate to getRequestURL() of wrapped request once
+ // support for the 2.2 < servlet API is dropped
+
+ StringBuffer url = new StringBuffer();
+ String scheme = req.getScheme();
+ int port = req.getServerPort();
+ if (port < 0)
+ {
+ // Work around java.net.URL bug
+ port = 80;
+ }
+
+ url.append(scheme);
+ url.append("://");
+ url.append(req.getServerName());
+ if ((scheme.equals("http") && (port != 80))
+ || (scheme.equals("https") && (port != 443))) {
+ url.append(':');
+ url.append(port);
+ }
+ url.append(req.getRequestURI());
+ return url;
+ }
+
+
+ /**
* Gets the servletPath attribute of the HttpServletRequestFacade object
*
*@return The servletPath value
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: cvs commit:
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/sessi
on HttpServletRequestFacade.java
Posted by Jon Scott Stevens <jo...@latchkey.com>.
on 1/17/02 6:02 PM, "dlr@apache.org" <dl...@apache.org> wrote:
> + if ((scheme.equals("http") && (port != 80))
> + || (scheme.equals("https") && (port != 443))) {
> + url.append(':');
> + url.append(port);
> + }
Formatting.
-jon
--
Standard rules apply: Ask any questions, and you get the job. ;-)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>