You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Erik Hatcher <ja...@ehatchersolutions.com> on 2002/10/29 14:54:29 UTC

Struts testing problem

Below is part of an e-mail thread from the struts-dev list.

Here's the situation - I upgraded to a nightly build of Struts, and that 
is the only change.  On Struts 1.1b2 all our Cactus tests succeeded, but 
with the nightly build (20021028) they all failed.  Logically you'd 
think the problem was with Struts, but our application still worked in 
the browser just fine.  Digging a bit deeper, a change was made in part 
of the request handling of Struts to call:

	request.getServletPath();

With Struts debugging enabled, I see this is returning "/something.do" 
when running through a web browser, but is returning "" when running 
through Cactus.

To further confuse issues, I'm using StrutsTestCase on top of Cactus.

I'm assuming something is misconfigured in the Cactus side of things 
either with our code or in the StrutsTestCase framework (which may need 
some adjustments for the Struts code changes).

Any clues?

Thanks,
	Erik


-------- Original Message --------
Subject: Re: Nightly build issue
Date: Mon, 28 Oct 2002 16:17:11 -0600
From: Erik Hatcher <ja...@ehatchersolutions.com>
To: Struts Developers List <st...@jakarta.apache.org>
References: <3D...@ehatchersolutions.com> 
<3D...@ehatchersolutions.com> 
<3D...@ehatchersolutions.com> <3D...@swbell.net>

Eddie Bush wrote:
 > Can you verify your assumption with the logging output?  It should say
 > what the value of matchPath is.  This would be a debug-level logging
 > statment indicated by a line stating:
 >
 > Selecting module for path <matchPath>

After getting the logging opened up, my results are <matchPath> is ""
(blank, not null) when running through Cactus/StrutsTestCase, but not
when running through a browser.  Odd.  I guess this is not a Struts
issue per se.  I'll take this up on the Cactus list when I get a chance.

	Erik





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts testing problem

Posted by Vincent Massol <vm...@octo.com>.
Hi Erik,

Sorry for taking so long to answer...

Here's the implementation of Cactus of getServletPath():

    public String getServletPath()
    {
        String result;

        if (this.url != null)
        {
            result = this.url.getServletPath();
            LOGGER.debug("Using simulated servlet path : [" + result +
"]");
        }
        else
        {
            result = this.request.getServletPath();
        }

        return result;
    }

What it means is that if you have used the WebRequest.setURL(....) API,
Cactus will return the servlet path you have specified in there. If not,
it will return the servlet path of the real original Http request
(that's the " this.request.getServletPath();" code).

Thus, I don't think this comes from Cactus. However, as you can see from
the code above, if you turn debugging on for Cactus you will get the
"Using simulated servlet path :[...]" string printed in the log if
you're using the setURL() API.

It may also be a problem in StrutsTestCase but then we need to ask that
project as I'm unfortunately not following it. 

Hope it helps,

Thanks and sorry for the trouble.
-Vincent

> -----Original Message-----
> From: Erik Hatcher [mailto:jakarta-struts@ehatchersolutions.com]
> Sent: 29 October 2002 13:54
> To: cactus-user@jakarta.apache.org
> Subject: Struts testing problem
> 
> Below is part of an e-mail thread from the struts-dev list.
> 
> Here's the situation - I upgraded to a nightly build of Struts, and
that
> is the only change.  On Struts 1.1b2 all our Cactus tests succeeded,
but
> with the nightly build (20021028) they all failed.  Logically you'd
> think the problem was with Struts, but our application still worked in
> the browser just fine.  Digging a bit deeper, a change was made in
part
> of the request handling of Struts to call:
> 
> 	request.getServletPath();
> 
> With Struts debugging enabled, I see this is returning "/something.do"
> when running through a web browser, but is returning "" when running
> through Cactus.
> 
> To further confuse issues, I'm using StrutsTestCase on top of Cactus.
> 
> I'm assuming something is misconfigured in the Cactus side of things
> either with our code or in the StrutsTestCase framework (which may
need
> some adjustments for the Struts code changes).
> 
> Any clues?
> 
> Thanks,
> 	Erik
> 
> 
> -------- Original Message --------
> Subject: Re: Nightly build issue
> Date: Mon, 28 Oct 2002 16:17:11 -0600
> From: Erik Hatcher <ja...@ehatchersolutions.com>
> To: Struts Developers List <st...@jakarta.apache.org>
> References: <3D...@ehatchersolutions.com>
> <3D...@ehatchersolutions.com>
> <3D...@ehatchersolutions.com> <3D...@swbell.net>
> 
> Eddie Bush wrote:
>  > Can you verify your assumption with the logging output?  It should
say
>  > what the value of matchPath is.  This would be a debug-level
logging
>  > statment indicated by a line stating:
>  >
>  > Selecting module for path <matchPath>
> 
> After getting the logging opened up, my results are <matchPath> is ""
> (blank, not null) when running through Cactus/StrutsTestCase, but not
> when running through a browser.  Odd.  I guess this is not a Struts
> issue per se.  I'll take this up on the Cactus list when I get a
chance.
> 
> 	Erik
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>