how to write the configuration file of struts application
if any one had simple struts application please it to me



how to write the configuration file of struts application if any one had simple struts application ..

Answer / surendra choudhury

//Sample struts-config.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration
1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-
config_1_1.dtd">
<struts-config> Form bean Definitions
<form-beans>
<form-bean name="CustomerForm"
type="mybank.example.CustomerForm"/>
<form-bean name="LogonForm"
type="mybank.example.LogonForm"/>
</form-beans> Global Forward Definitions
<global-forwards>
<forward name="logon" path="/logon.jsp"/>
<forward name="logoff" path="/logoff.do"/>
</global-forwards> Action Mappings
<action-mappings>
<action path="/submitDetailForm"
type="mybank.example.CustomerAction"
name="CustomerForm"
scope="request"
validate="true"
input="/CustomerDetailForm.jsp">
<forward name="success"
path="/ThankYou.jsp"
redirect=”true” />
<forward name="failure"
path="/Failure.jsp" />
</action>
<action path=”/logoff” parameter=”/logoff.jsp”
type=”org.apache.struts.action.ForwardAction” />
</action-mappings> Controller Configuration
<controller
processorClass="org.apache.struts.action.RequestProcessor" /
>
<message-resources
parameter="mybank.ApplicationResources"/>
</struts-config> Message Resource Definition

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More Struts Interview Questions

What is the purpose of struct-config.xml in struct2?

0 Answers  


Is Struts Action class Thread Safe?

14 Answers   Wipro,


What is the purpose of @before annotation?

0 Answers  


Which interceptor is responsible for mapping request parameters to action class Java Bean properties?

0 Answers  


How struts control data flow?

0 Answers  






can we change the location of struts-config.xml file?

2 Answers   TCS,


What do you mean by inner class and anonymous class?

0 Answers  


what is frame work in struts?

3 Answers   Infosys,


What are the major differences between html tags and strut specific html tags?

0 Answers  


What is controller in struts2?

0 Answers  


Explain integrate log4j in struts2 application?

0 Answers  


Where can I get help with struts?

0 Answers  


Categories