Hi Kim, Hehe ... you've discovered a bug ... I have just corrected it. I had forgotten to wrap the getRequestURL() method and thus Cactus was calling the original HttpServletRequest.getRequestURL().
Thanks -Vincent > -----Original Message----- > From: kim [mailto:kim] On Behalf Of Kim Madsen > Sent: 28 February 2002 15:49 > Subject: getRequestURL() > > I am have recently upgraded from JBoss V2.4.1 with Tomcat V3.3.2 to > JBoss V2.4.4 with Tomcat 4.0.1. Doing that I have also changed from > Cactus > V1.3 using Servlet API 2.2 to Cactus V1.3 using Servlet API 2.3 > > In Servlet API V2.3 javax.servlet.http.HttpUtils has been deprecated. > > Therefore I wanted to change my code from: > > // Servlet API V2.2 > String urlStr = > javax.servlet.http.HttpUtils.getRequestURL(request).toString(); > diag.debug("Url string = " + urlStr); > > to: > //Servlet API V2.3 > String urlStr = request.getRequestURL().toString(); > diag.debug("Url string = " + urlStr); > > where request if of type HttpServletRequest. > > However, when I did this change my tests which was working before > started failing. I found that with the new method call I got the URL > of the Cactus ServletRedirector rather than the one I set up im by > beginXXX > > The setup is as follows: > > public void beginLongestMatchWins(org.apache.cactus.WebRequest > request) > throws Exception { > > diag.debug("Setup http request parameters"); > request.setURL("localhost","","","/cheap",""); > request.setAutomaticSession(true); > } > > This get logged when using HttpServletRequest.getRequestURL(): > > [Request] (58) (<init>) () - Url string = > http://localhost:8080/cactus/ServletRedirector/ > > > This get logged when using HttpUtils.getRequestURL: > > [Request] (58) (<init>) () - Url string = http://localhost/cheap > > > Now it is not a big problem, as I can just keep the old code in there. > However, it would like to get rid of the warning about depricated stuff > when compiling. > So if you can offer any help on this, I would appreciate it. > > Cheers, Kim > > -- > To unsubscribe, e-mail: <mailto:cactus-user- > [EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:cactus-user- > [EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
