Can we have multiple struts-config files in a single web
app? If yes why should we have them? Will multiple copies
make any impact on performance?

Answer Posted / sumit sharma

Yes it is possible... If you are developing the distributed
applications (means do you have diff modules)
then you can provide any number of struts-config.xml files
based on your number of modules.
But the thing is you must enter those struts-config.xml
files details in deployment descripter (i.e. web.xml) like
<init-param>
<param-name>
config</param-name>
<param-value>/WEB-INF/struts-first-config.xml /WEB-
INF/struts-second-config.xml /WEB-INF/struts-third-
config.xml</param-value>
</init-param>
Here I assumed as 'I have 3 modules'. Thats why I entered 3
struts-config.xml files information.
In the time of calling files which are provided under
different modules you must provide Page and prefix
attributes in
your URL.

Is This Answer Correct ?    40 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are Struts2 core components?

572


What is the different actions available in struts?

547


What is the purpose of @result?

586


What are the important methods of actionform?

594


How nested beans can be used in Struts applications?

555






What are the steps involved in creating a strut application?

520


Explain integrate log4j in struts2 application?

575


What is the purpose of @element?

589


What is struts framework?

556


How can we display all validation errors to user on jsp page?

656


What is the role of action class in struts?

564


How to build struts application in eclipse?

534


How can we write our own interceptor and map it for action?

578


Explain about tiles?

582


What is the life cycle of actionform?

559