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

How long do struts last?

708


What are action errors and error?

791


Can you explain value stack?

712


How does one create an action in struts 2?

703


What do you mean by inner class and anonymous class?

765


Is struts compatible with other java technologies?

706


What is actionmapping?

819


Which file is used by controller to get mapping information for request routing?

794


What is the purpose of @after?

750


How can we get Servlet API Request, Response, HttpSession etc Objects in action classes?

815


Can explain about the validations and in your project where did u used the validations?

6961


What types of validations are available in xml based validation in struts2?

785


What is the default location of result pages and how can we change it?

768


What is the difference between validation.xml and validator-rules.xml files in struts?

687


How does struts2 token work?

719