GeeCON Prague 2014*
The moose likes Struts and the fly likes multiple struts-confing file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "multiple struts-confing file " Watch "multiple struts-confing file " New topic
Author

multiple struts-confing file

Jayesh Sisodiya
Greenhorn

Joined: Apr 12, 2007
Posts: 11
HI
i am useing multiple struts-config file.
one is default
second is module
how to call module config file ?
in module config file ..global-forward,action-mapping.

so how to call all this ?
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

You need to mention all the config files in the Config param of the <servlet> element where you define ActionServlet.

You have two different cases.

Case 1: You can have several configuration (struts-config.xml) files based on the modules for a single large application



You need to specify all your configuration files separated by comma while mentioning the complete relative path of the files.

Case 2: You can have a logical division of the application based on the different URLs being invoked .



HtH.
[ May 22, 2007: Message edited by: Raghavan Muthu ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Jayesh Sisodiya
Greenhorn

Joined: Apr 12, 2007
Posts: 11
hi
that i do but my problem is how to use that child1 or child2 in jsp or servlet.

it mean i have one jsp file ok
------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/moduleA</param-name>
<param-value>/WEB-INF/myupload-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
---------------------------

ok this is my web.xml file

<html:link forward="uploadFile">Upload File</html:link>
now i m using this link so how i know my reqesting passing where?
it mean in which confing file i m calling.
i want to call file moduleA. how i will call.?
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

I think Struts should automatically find out in which config xml file the requested mapping is present.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple struts-confing file