jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Helen Rehn <hr...@us.ibm.com>
Subject RE: Behavior of getRequestURL in ServletTestCase
Date Wed, 19 Feb 2003 17:42:07 GMT




Hi,

I do actually have 1.4.1, I was wrong about that.

I've attached the server-side log.  The test I ran simply checked the
request.getRequestURL to see if it contained "8082" and failed if it did
not.

(See attached file: CACTUS~1.LOG)

Nell Rehn
WebSphere Advanced Design and Technology
hrehn@us.ibm.com
(919) 254-1088 t/l 444-1088


                                                                                         
                                        
                      "Vincent Massol"                                                   
                                        
                      <vmassol@octo.com        To:       "'Cactus Users List'" <cactus-user@jakarta.apache.org>
                  
                      >                        cc:       Helen Rehn/Durham/IBM@IBMUS  
                                           
                                               Subject:  RE: Behavior of getRequestURL in
ServletTestCase                         
                      02/19/2003 08:51                                                   
                                        
                      AM                                                                 
                                        
                      Please respond to                                                  
                                        
                      "Cactus Users                                                      
                                        
                      List"                                                              
                                        
                                                                                         
                                        
                                                                                         
                                        




Hi Helen,

One thing that you should do is use Cactus 1.4.1 as it contains several
bug fixes from 1.4.

Then, you should enable cactus logging (see the configuration howto on
the cactus web site for how to perform this) and send us the generated
log files.

Thanks
-Vincent

> -----Original Message-----
> From: Helen Rehn [mailto:hrehn@us.ibm.com]
> Sent: 19 February 2003 14:31
> To: Cactus Users List
> Subject: RE: Behavior of getRequestURL in ServletTestCase
>
>
>
>
>
> Hi,
>
> Yes, I had looked at the source code, but the reason for my confusion
was
> the fact that I had not defined a simulation URL.  Calling
> request.getRequestURL() on a servlet or jsp outside of the cactus
> environment returns the correct port with no problems, so I'm not sure
> what
> is happening.  I'm just looking for any tips on how I might go about
> debugging the problem, because I'm not sure where to look next.
>
> Thanks,
> Nell
>
> Nell Rehn
> WebSphere Advanced Design and Technology
> hrehn@us.ibm.com
> (919) 254-1088 t/l 444-1088
>
>
>
>                       "Vincent Massol"
>                       <vmassol@octo.com        To:       "'Cactus
Users
> List'" <cactus-user@jakarta.apache.org>
>                       >                        cc:       Helen
> Rehn/Durham/IBM@IBMUS
>                                                Subject:  RE: Behavior
of
> getRequestURL in ServletTestCase
>                       02/19/2003 03:39
>                       AM
>                       Please respond to
>                       "Cactus Users
>                       List"
>
>
>
>
>
>
> Hi Helen,
>
> If you have defined a simulation URL by calling WebRequest.setURL() in
> your beginXXX() method, then getRequestURL() will return the values
you
> have set there. Otherwise, it will return the real request URL.
>
> Here's the source code:
>
>     public StringBuffer getRequestURL()
>     {
>         StringBuffer result;
>
>         if (this.url != null)
>         {
>             result = new StringBuffer(this.url.getProtocol() + "://"
>                 + getServerName() + ":" + getServerPort() +
> getContextPath()
>                 + getServletPath() + getPathInfo());
>         }
>         else
>         {
>             result = this.request.getRequestURL();
>         }
>
>         return result;
>     }
>
> where this.url is the simulated URL (null if none has been defined)
and
> where this.request is the original HttpServletRequest (FYI, Cactus is
> wrapping HttpServletRequest in order to correctly return values in
> accordance with the simulated URL when defined).
>
> Hope this helps,
> -Vincent
>
> > -----Original Message-----
> > From: Helen Rehn [mailto:hrehn@us.ibm.com]
> > Sent: 17 February 2003 19:59
> > To: cactus-user@jakarta.apache.org
> > Subject: Behavior of getRequestURL in ServletTestCase
> >
> >
> >
> >
> >
> > Hi,
> >
> > I'm confused about the behavior of getRequestURL in ServletTestCase.
> I'm
> > using Cactus 1.4 and WebSphere.  I've extended ServletTestCase, and
in
> one
> > of my test methods, I call:
> >
> > ((HttpServletRequest) request).getRequestURL().toString()
> >
> > My webapp is running on port 8082, which is what is specified in
> > cactus.properties but instead I get the following output:
> > http://localhost:80/testnullnull
> >
> > Why is the port not what I expect?
> >
> > Thanks,
> > Nell
> >
> > Nell Rehn
> > WebSphere Advanced Design and Technology
> > hrehn@us.ibm.com
> > (919) 254-1088 t/l 444-1088
> >
> >


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message