You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Allen <310 63rd St.> on 2001/07/23 21:11:43 UTC
problems mapping multiple ActionServlets
This might be more appropriate for the Tomcat user
list, but I'll try anyway. I'm using Tomcat 3.2.2
and trying to map multiple ActionServlets in
web.xml. I have a <servlet-mapping> for "*.do"
which I execute for the form action "search.do",
and everything works fine when this is the only
<servlet-mapping> in web.xml. But as soon as I
add another <servlet-mapping> for "*.authDo", when
I try to execute "search.do", "search.authDo" is
called (it even appears in the URL), which I don't
understand since I don't call "search.authDo" from
anywhere in my page (or anywhere on the site). If
I the change to added mapping to any name, like
"*.anything", "search.anything" is called .
The pertinent code is below. Many advanced
thanks.
Dave
>From the jsp:
<form:form
action="search.do"
name="caretoolSearchForm"
type="com.getcare.servlet.CaretoolSearchForm">
>From web.xml:
<servlet>
<servlet-name>Action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>com.getcare.servlet.ErrorMessages</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>authAction</servlet-name>
<servlet-class>com.getcare.servlet.CaretoolActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>com.getcare.servlet.ErrorMessages</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-auth-config.xml</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>authAction</servlet-name>
<url-pattern>*.authDo</url-pattern>
</servlet-mapping>