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 <li...@ehatchersolutions.com> on 2001/11/05 22:30:48 UTC

ServletRedirector mapping

This might be a cactus-dev issue, but I'll toss it out here since all
relevant parties are on this list also.  In order to get Cactus working, I
had to modify the servlet mapping to have "/*" rather than "/" at the end of
ServletRedirector, like this:

    <servlet-mapping>
        <servlet-name>ServletRedirector</servlet-name>
        <url-pattern>/ServletRedirector/*</url-pattern>
    </servlet-mapping>

Servlet 2.2 spec says this:

10.2 Specification of Mappings
In the web application deployment descriptor, the following syntax is used
to define mappings:
. A string beginning with a '/' character and ending with a '/*' postfix is
used as a path mapping.
. A string beginning with a '*.' prefix is used as an extension mapping.
. All other strings are used as exact matches only
. A string containing only the '/' character indicates that servlet
specified by the mapping becomes the "default" servlet of the application.

So it seems the Cactus mapping of ServletRedirector is not compliant with
the spec.  A quick glance at the Servlet 2.3 spec appears to say the same
thing as the 2.2 spec.

Is there any reason not to put the "/*" at the end?  It makes it work in
WebSphere at least!  :)  Are all the other containers Cactus just implying
the "*"?  I haven't dug into Cactus code to see how it fires things to the
ServletRedirector - is it sending a GET string to it?  Or just hitting
/ServletRedirector directly using POST and now URL parameters?

Thanks,
    Erik



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


Re: [PATCH] Re: ServletRedirector mapping

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

I should have mentionned that I have already patched the documentation
locally on my computer but was waiting for release 1.3 to put it on the web
site ? Why ? Because, if you remove the trailing "/" with Cactus 1.2, one of
the test will fail ... So, we would rightly get complaints from users saying
that they applied the doc from the web site and it doesn't work ...

Thanks
-Vincent

----- Original Message -----
From: "Erik Hatcher" <li...@ehatchersolutions.com>
To: "Cactus Users List" <ca...@jakarta.apache.org>; "Vincent Massol"
<vm...@octo.com>
Sent: Wednesday, November 07, 2001 11:14 AM
Subject: [PATCH] Re: ServletRedirector mapping


> I guess I was just looking at outdated documentation then.  Note at the
> bottom of this page: http://jakarta.apache.org/cactus/howto_config.html it
> shows:
>
>     <url-pattern>/ServletRedirector/</url-pattern>
>
> That should be corrected.  I'll even go one step further and submit a
patch!
> :)
>
>     Erik
>
>
> ----- Original Message -----
> From: "Vincent Massol" <vm...@octo.com>
> To: "Cactus Users List" <ca...@jakarta.apache.org>
> Sent: Wednesday, November 07, 2001 4:09 AM
> Subject: Re: ServletRedirector mapping
>
>
> >
> >
> > ----- Original Message -----
> > From: "Erik Hatcher" <li...@ehatchersolutions.com>
> > To: <ca...@jakarta.apache.org>
> > Sent: Monday, November 05, 2001 9:30 PM
> > Subject: ServletRedirector mapping
> >
> >
> > > This might be a cactus-dev issue, but I'll toss it out here since all
> > > relevant parties are on this list also.  In order to get Cactus
working,
> I
> > > had to modify the servlet mapping to have "/*" rather than "/" at the
> end
> > of
> > > ServletRedirector, like this:
> > >
> > >     <servlet-mapping>
> > >         <servlet-name>ServletRedirector</servlet-name>
> > >         <url-pattern>/ServletRedirector/*</url-pattern>
> > >     </servlet-mapping>
> > >
> > > Servlet 2.2 spec says this:
> > >
> > > 10.2 Specification of Mappings
> > > In the web application deployment descriptor, the following syntax is
> used
> > > to define mappings:
> > > . A string beginning with a '/' character and ending with a '/*'
postfix
> > is
> > > used as a path mapping.
> > > . A string beginning with a '*.' prefix is used as an extension
mapping.
> > > . All other strings are used as exact matches only
> > > . A string containing only the '/' character indicates that servlet
> > > specified by the mapping becomes the "default" servlet of the
> application.
> > >
> > > So it seems the Cactus mapping of ServletRedirector is not compliant
> with
> > > the spec.  A quick glance at the Servlet 2.3 spec appears to say the
> same
> > > thing as the 2.2 spec.
> > >
> > > Is there any reason not to put the "/*" at the end?  It makes it work
in
> > > WebSphere at least!  :)  Are all the other containers Cactus just
> implying
> > > the "*"?
> >
> > I have tried Cactus on 10 different servlet engines and they all worked
> with
> > "/ServletRedirector" (forget "/ServletRedirector/" which is no longer
> valid
> > in Cactus 1." - and doesn't work if you're passing parameters). The
reason
> > is that the ServletRedirector is not meant as a path but as the last
> element
> > in the URL (exact match). So "/ServletRedirector/*" would work but would
> > fire for urls such as ".../ServletRedirector/something/other?xxx=yyy".
> > However, we want the last element in the URL to be the redirector. so
> > "/ServletRedirector" should work on all engines.
> >
> > > I haven't dug into Cactus code to see how it fires things to the
> > > ServletRedirector - is it sending a GET string to it?  Or just hitting
> > > /ServletRedirector directly using POST and now URL parameters?
> > >
> >
> > it uses the url in cactus.properties and either a post or get depending
on
> > whether the user has set post parameters in WebRequest.
> >
> > > Thanks,
> > >     Erik
> > >
> >
> > Thanks
> > -Vincent
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>


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


[PATCH] Re: ServletRedirector mapping

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
I guess I was just looking at outdated documentation then.  Note at the
bottom of this page: http://jakarta.apache.org/cactus/howto_config.html it
shows:

    <url-pattern>/ServletRedirector/</url-pattern>

That should be corrected.  I'll even go one step further and submit a patch!
:)

    Erik


----- Original Message -----
From: "Vincent Massol" <vm...@octo.com>
To: "Cactus Users List" <ca...@jakarta.apache.org>
Sent: Wednesday, November 07, 2001 4:09 AM
Subject: Re: ServletRedirector mapping


>
>
> ----- Original Message -----
> From: "Erik Hatcher" <li...@ehatchersolutions.com>
> To: <ca...@jakarta.apache.org>
> Sent: Monday, November 05, 2001 9:30 PM
> Subject: ServletRedirector mapping
>
>
> > This might be a cactus-dev issue, but I'll toss it out here since all
> > relevant parties are on this list also.  In order to get Cactus working,
I
> > had to modify the servlet mapping to have "/*" rather than "/" at the
end
> of
> > ServletRedirector, like this:
> >
> >     <servlet-mapping>
> >         <servlet-name>ServletRedirector</servlet-name>
> >         <url-pattern>/ServletRedirector/*</url-pattern>
> >     </servlet-mapping>
> >
> > Servlet 2.2 spec says this:
> >
> > 10.2 Specification of Mappings
> > In the web application deployment descriptor, the following syntax is
used
> > to define mappings:
> > . A string beginning with a '/' character and ending with a '/*' postfix
> is
> > used as a path mapping.
> > . A string beginning with a '*.' prefix is used as an extension mapping.
> > . All other strings are used as exact matches only
> > . A string containing only the '/' character indicates that servlet
> > specified by the mapping becomes the "default" servlet of the
application.
> >
> > So it seems the Cactus mapping of ServletRedirector is not compliant
with
> > the spec.  A quick glance at the Servlet 2.3 spec appears to say the
same
> > thing as the 2.2 spec.
> >
> > Is there any reason not to put the "/*" at the end?  It makes it work in
> > WebSphere at least!  :)  Are all the other containers Cactus just
implying
> > the "*"?
>
> I have tried Cactus on 10 different servlet engines and they all worked
with
> "/ServletRedirector" (forget "/ServletRedirector/" which is no longer
valid
> in Cactus 1." - and doesn't work if you're passing parameters). The reason
> is that the ServletRedirector is not meant as a path but as the last
element
> in the URL (exact match). So "/ServletRedirector/*" would work but would
> fire for urls such as ".../ServletRedirector/something/other?xxx=yyy".
> However, we want the last element in the URL to be the redirector. so
> "/ServletRedirector" should work on all engines.
>
> > I haven't dug into Cactus code to see how it fires things to the
> > ServletRedirector - is it sending a GET string to it?  Or just hitting
> > /ServletRedirector directly using POST and now URL parameters?
> >
>
> it uses the url in cactus.properties and either a post or get depending on
> whether the user has set post parameters in WebRequest.
>
> > Thanks,
> >     Erik
> >
>
> Thanks
> -Vincent
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

Re: ServletRedirector mapping

Posted by Vincent Massol <vm...@octo.com>.

----- Original Message -----
From: "Erik Hatcher" <li...@ehatchersolutions.com>
To: <ca...@jakarta.apache.org>
Sent: Monday, November 05, 2001 9:30 PM
Subject: ServletRedirector mapping


> This might be a cactus-dev issue, but I'll toss it out here since all
> relevant parties are on this list also.  In order to get Cactus working, I
> had to modify the servlet mapping to have "/*" rather than "/" at the end
of
> ServletRedirector, like this:
>
>     <servlet-mapping>
>         <servlet-name>ServletRedirector</servlet-name>
>         <url-pattern>/ServletRedirector/*</url-pattern>
>     </servlet-mapping>
>
> Servlet 2.2 spec says this:
>
> 10.2 Specification of Mappings
> In the web application deployment descriptor, the following syntax is used
> to define mappings:
> . A string beginning with a '/' character and ending with a '/*' postfix
is
> used as a path mapping.
> . A string beginning with a '*.' prefix is used as an extension mapping.
> . All other strings are used as exact matches only
> . A string containing only the '/' character indicates that servlet
> specified by the mapping becomes the "default" servlet of the application.
>
> So it seems the Cactus mapping of ServletRedirector is not compliant with
> the spec.  A quick glance at the Servlet 2.3 spec appears to say the same
> thing as the 2.2 spec.
>
> Is there any reason not to put the "/*" at the end?  It makes it work in
> WebSphere at least!  :)  Are all the other containers Cactus just implying
> the "*"?

I have tried Cactus on 10 different servlet engines and they all worked with
"/ServletRedirector" (forget "/ServletRedirector/" which is no longer valid
in Cactus 1." - and doesn't work if you're passing parameters). The reason
is that the ServletRedirector is not meant as a path but as the last element
in the URL (exact match). So "/ServletRedirector/*" would work but would
fire for urls such as ".../ServletRedirector/something/other?xxx=yyy".
However, we want the last element in the URL to be the redirector. so
"/ServletRedirector" should work on all engines.

> I haven't dug into Cactus code to see how it fires things to the
> ServletRedirector - is it sending a GET string to it?  Or just hitting
> /ServletRedirector directly using POST and now URL parameters?
>

it uses the url in cactus.properties and either a post or get depending on
whether the user has set post parameters in WebRequest.

> Thanks,
>     Erik
>

Thanks
-Vincent


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


Re: [poll] ok for aspectj in cactus 1.3 ?

Posted by Vincent Massol <vm...@octo.com>.

----- Original Message -----
From: <al...@dsl.ab.ca>
To: "Cactus Developers List" <ca...@jakarta.apache.org>
Sent: Monday, November 05, 2001 10:30 PM
Subject: [poll] ok for aspectj in cactus 1.3 ?


> Hi,
>
>   Adding an extra jar file to get Cactus parameter checking is a tiny
> price to pay for a large dividend.
>
>   I am interested in AspectJ but do not have the time to learn it.
>
>   Seeing AspectJ in a real project will help.
>
>   Are there any generic open source aspect libraries?  One example you
> mentioned: logging entry, exit to methods.
>

Not that I know of. However, there are some examples provided with aspectj.
I have used these as inspiration and rewritten one logging aspect. I plan
(if I find some time) to make it generic and donate it to the log4j project.

> Thanks.
>
> Alvin.
>
> Vincent Massol writes:
>  > Hi,
>  >
>  > I'd like to include aspectj within Cactus as a framework that would
help :
>  > - generate cactus logs
>  > - runtime configuration checking to verify that all cactus parameters
are correctly set
>  >
>  > The only drawback for users is the need for an additional jar in the
Cactus classpaths (client and server side) : aspectrt.jar (size = 24Ko).
>  >
>  > I have finished developing the logging part (quite nice really ... :) )
and would like to commit my changes to CVS. As no one answered when I last
asked the question, I was going through another round to offer you a last
chance to say no ... :-)
>  >
>  > Check my previous emails on the subject for details :
>  >
>  >
http://www.mail-archive.com/cgi-bin/htsearch?method=and&format=short&config=
cactus-user_jakarta_apache_org&restrict=&exclude=&words=aspectj
>  >
>  > Thanks
>  > -Vincent
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


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


[poll] ok for aspectj in cactus 1.3 ?

Posted by al...@dsl.ab.ca.
Hi,

  Adding an extra jar file to get Cactus parameter checking is a tiny
price to pay for a large dividend.

  I am interested in AspectJ but do not have the time to learn it.

  Seeing AspectJ in a real project will help.

  Are there any generic open source aspect libraries?  One example you 
mentioned: logging entry, exit to methods.

Thanks.

Alvin.

Vincent Massol writes:
 > Hi,
 > 
 > I'd like to include aspectj within Cactus as a framework that would help :
 > - generate cactus logs
 > - runtime configuration checking to verify that all cactus parameters are correctly set
 > 
 > The only drawback for users is the need for an additional jar in the Cactus classpaths (client and server side) : aspectrt.jar (size = 24Ko).
 > 
 > I have finished developing the logging part (quite nice really ... :) ) and would like to commit my changes to CVS. As no one answered when I last asked the question, I was going through another round to offer you a last chance to say no ... :-)
 > 
 > Check my previous emails on the subject for details :
 > 
 > http://www.mail-archive.com/cgi-bin/htsearch?method=and&format=short&config=cactus-user_jakarta_apache_org&restrict=&exclude=&words=aspectj
 > 
 > Thanks
 > -Vincent

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


[poll] ok for aspectj in cactus 1.3 ?

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

I'd like to include aspectj within Cactus as a framework that would help :
- generate cactus logs
- runtime configuration checking to verify that all cactus parameters are correctly set

The only drawback for users is the need for an additional jar in the Cactus classpaths (client and server side) : aspectrt.jar (size = 24Ko).

I have finished developing the logging part (quite nice really ... :) ) and would like to commit my changes to CVS. As no one answered when I last asked the question, I was going through another round to offer you a last chance to say no ... :-)

Check my previous emails on the subject for details :

http://www.mail-archive.com/cgi-bin/htsearch?method=and&format=short&config=cactus-user_jakarta_apache_org&restrict=&exclude=&words=aspectj

Thanks
-Vincent