You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Erickson <de...@cmcflex.com> on 2003/07/25 19:43:26 UTC
Using Actions with specific paths
Hi I have been having a very difficult time implementing this, basically
what I'd like to do is have Struts match some actions based on the path they
are executed from, but I am not sure how to setup the web.xml for that nor
the struts-config.xml.
Example I'd like:
/mywebapp/navigate.do runs a different action class than
/mywebapp/control/navigate.do
And I am confused at how to setup the struts config to match the /control
part, and how exactly I need to setup the web.xml to map everything to
struts thats *.do. Right now in web.xml it looks like:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
But I'm thinking that if I also add /control/*.do that the struts config
would match navigate from either path to the same class?? I don't know if i
explained myself clearly.. but any help would be greatly appreciated.
Thanks,
David
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Using Actions with specific paths
Posted by Kris Schneider <kr...@dotech.com>.
Maybe I'm missing something, but have you tried (struts-config):
<action path="/navigate" type="foo.Action1" ...
<action path="/control/navigate" type="foo.Action2" ...
Quoting David Erickson <de...@cmcflex.com>:
> Hi I have been having a very difficult time implementing this, basically
> what I'd like to do is have Struts match some actions based on the path
> they
> are executed from, but I am not sure how to setup the web.xml for that nor
> the struts-config.xml.
>
> Example I'd like:
>
> /mywebapp/navigate.do runs a different action class than
> /mywebapp/control/navigate.do
>
> And I am confused at how to setup the struts config to match the /control
> part, and how exactly I need to setup the web.xml to map everything to
> struts thats *.do. Right now in web.xml it looks like:
> <servlet-mapping>
>
> <servlet-name>action</servlet-name>
>
> <url-pattern>*.do</url-pattern>
>
> </servlet-mapping>
>
>
>
> But I'm thinking that if I also add /control/*.do that the struts config
> would match navigate from either path to the same class?? I don't know if
> i
> explained myself clearly.. but any help would be greatly appreciated.
>
> Thanks,
>
> David
--
Kris Schneider <ma...@dotech.com>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org