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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are struts in java?

504


What is the difference between plain-validator and field-validator?

520


How do you create message resource?

584


Are struts still used?

518


What is the use of execAndWait interceptor?

558






How many struts config file can be created in struts?

497


What is the use of namespace in action mapping in Struts2?

578


What is the purpose of @requiredstringvalidator?

560


When do I need “struts.jar” on my classpath?

541


What is the difference in using Action interface and ActionSupport class for our action classes, which one you would prefer?

568


In struts.xml, what does the attribute "method" stands for in the "action" tag?

530


How to get data from the velocity page in a action class?

567


In which order struts framework searches for a message bundle?

560


Explain about the tag?

627


What is dispatchaction?

627