Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

web.xml help - struts

Thread view: 
Vijay - 08 May 2005 11:43 GMT
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...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.