I looked at that the other day because I wanted to do something like:

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.jsp</url-pattern>
</servlet-mapping>

and in my controller (which would be a subclass of ActionServlet) I would
disallow *.jsp and throw to a page and then process *.do normally. I noticed
that all my actions where then generated (in my JSP) as <html:form
action="/login.jsp" > instead of action="login.do"  so I looked at the
struts source and saw that only one pattern could be specified and so it
fills that pattern with the last one entered in the web.xml.

Unless I was just tired and was seeing things. :-)  That is how I determined
it works.


-----Original Message-----
From: Laurent Garcia [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 04, 2003 11:04 AM
To: [EMAIL PROTECTED]
Subject: Mutil URL access to a struts application

Hi all,

I just finished my struts 1.0 application, and now I would like to access to
my application through several URL :

My root context is APP and I want to access to my application with, 
for example :

http://localhost:9080/APP/init.do
http://localhost:9080/APP/foo/init.do
http://localhost:9080/APP/foo2/init.do

and depend on the url context I want to have a different behaviour in my
application

But I don't want to change anything in my struts-config.xml file (perhaps in
the jsp).

I have something like that :

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>
in my web.xml, I try  to add <url-pattern>/foo/*.do</url-pattern> with no
success.

Thanks,


Laurent





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to