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 front controller in struts2?

0 Answers  


How is forward action used for integration?

0 Answers  


What is the use of jsonvalidation in struts?

0 Answers  


what is the difference between ServletContext and ServletConfig?

4 Answers  


List some bundled validators?

0 Answers  






What is the purpose of @before?

0 Answers  


What do you mean by a custom tag?

0 Answers  


How can I make own ActionServlet? with example

8 Answers   IBM, TCS,


what are java stuts? what are there uses

2 Answers   Rupa, Tech Mahindra,


What are the differences between Struts1 and Struts2 or how Struts2 is better than Struts1?

0 Answers  


How we can configured action mapping in struts?

0 Answers  


What is the difference between struts and spring?

0 Answers  


Categories