hi all,
I am having trouble specifying two servlets for two types of action
classes. My web.xml entries are as follows:
<servlet>
<servlet-name>adminaction</servlet-name>
<servlet-class>com.web.AdminActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>usersaction</servlet-name>
<servlet-class>com.web.UsersActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/users-struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>adminaction</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>usersaction</servlet-name>
<url-pattern>*.job</url-pattern>
</servlet-mapping>
My problem is that even the action-mappings defined in
struts-config.xml are appended .job instead of .do. And any of the
admin action is not accessible. (it gives me [RequestProcessor] Invalid
path /jobOptionsAct was requested error)
Though I am able to access the action mappings defined in
users-struts-config.xml with the .job url pattern.
Please help... Is it that we can not define two action servlets and two
struts-config files inside the same web application??
Vijay
Tobias Schierge - 08 May 2005 15:58 GMT
> Please help... Is it that we can not define two action servlets and two
> struts-config files inside the same web application??
Is it required that you use two different servlets? Otherwise you could
check for configuring multiple struts modules which can have different
config files.
Regards,
Tobias

Signature
<http://www.schierge.de/tobias/>
Wendy S - 09 May 2005 02:39 GMT
"Vijay" <vijay21@gmail.com> wroteservlet-mapping>
> Please help... Is it that we can not define two action servlets and two
> struts-config files inside the same web application??
I believe that's true, there should be only one controller. Although I
can't find it explicitly stated, all of the Struts documentation refers to
"the controller".
Struts does have the concept of 'modules' which will let you split the
application up into sections, such as your 'user' and 'admin'. You can have
multiple config files in that case.
Here's some documentation on configuring modules, I'm sure Google can turn
up more.
http://struts.apache.org/userGuide/configuration.html#dd_config_modules

Signature
Wendy S
Vijay - 12 May 2005 07:20 GMT
Hi Tobias and Wendy,
Thanks for making things clear. I also found that struts applications
must have only one controller.
Thankyou for helping...