You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Ahnve <ma...@lecando.com> on 2001/02/09 15:45:08 UTC

Prefix mapping doesn't work

We have the following setup:

struts-config.xml:

<action path="/updateUserProperties"
	type="com.lecando.web.actions.user.UpdateUserPropertiesAction"
	name="userPropertiesForm"
	scope="request"
	validate="false">
	<forward name="success" path="/users/users/user_properties.jsp"/>
	<forward name="failure" path="/testsuccess.jsp"/>
</action>

web.xml

<servlet-mapping>
	<servlet-name>ActionServlet</servlet-name>
	<url-pattern>/action/*</url-pattern>
</servlet-mapping>


Meaning of course prefix mapping, and to reach the action defined above
one would have to use the url
www.awesomesite.com/action/updateUserProperties. So far we're OK.

But if we want to introduce a form tag into the mix, and we want do want
that, these days we have set it up like:

<html:form action="/updateUserProperties">

because the tag path must match action path. This means of course that
the requested url when submitting will be
www.awesomesite.com/updateUserProperties without the 'action' part
resulting in 404-URL Not Found and unhappy developers are all over the
place. 

We used to be able to use <html:form
action="/action/updateUserProperties">, but that fails. 

I've searched the archives extensively and have come up with nothing,
making me think that either:

1. I'm not as bright as I like to picture myself, and that I've just
missed something really simple.
2. We're the only ones left in the world using prefix mapping and that
no one else just hasn't noticed or bothered.

Is the truth out there? Any help is greatly appreciated.

/Marcus

-- 
Marcus Ahnve                          email: marcus.ahnve@lecando.com
Lecando AB                           Office: +46-(0)8-634 94 18
Sweden                               Mobile: +46-(0)70-462 19 18
www.lecando.com                        ICQ#: 4564879