You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tejesh Shetty <Ts...@mortgagehub.com> on 2006/11/08 20:02:05 UTC

struts configuration tweaking

I am currently using struts-1.2.8 and in my web.xml all '*.do' are
handled by ActionServlet.  So in my form action value is
'/contextRoot/logon.do'.

 

Now I want couple of my actions to be handled without .do but not all of
them. So say for logon I want struts to kick in when form action value
is '/contextRoot/logon'.  Does anyone knows what changes in web.xml (and
if in any other config files) have to be done to take care of this
scenario. I only need to be done for only few of the actions and not all
of them.

 

Thanks.


Re: struts configuration tweaking

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/8/06, Laurie Harper <la...@holoweb.net> wrote:

> You can either use prefix mapping (/do/*) or suffix mapping (*.do).
> Unfortunately, you can't mix them, using one style for some requests and
> the other for other requests. Struts doesn't support having multiple
> servlet mappings for ActionServlet.
>
> Why do you need to do that? Perhaps there's an alternative approach you
> could take to solve your underlying use case.

Here's an interesting idea that I ran across a while ago... map static
content explicitly, and let the Action servlet handle everything else.

http://www.lunatech.com/archives/2005/07/29/struts-urls

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts configuration tweaking

Posted by Laurie Harper <la...@holoweb.net>.
Tejesh Shetty wrote:
> I am currently using struts-1.2.8 and in my web.xml all '*.do' are
> handled by ActionServlet.  So in my form action value is
> '/contextRoot/logon.do'.
> 
> Now I want couple of my actions to be handled without .do but not all of
> them. So say for logon I want struts to kick in when form action value
> is '/contextRoot/logon'.  Does anyone knows what changes in web.xml (and
> if in any other config files) have to be done to take care of this
> scenario. I only need to be done for only few of the actions and not all
> of them.

You can either use prefix mapping (/do/*) or suffix mapping (*.do). 
Unfortunately, you can't mix them, using one style for some requests and 
the other for other requests. Struts doesn't support having multiple 
servlet mappings for ActionServlet.

Why do you need to do that? Perhaps there's an alternative approach you 
could take to solve your underlying use case.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org