how to write the configuration file of struts application
if any one had simple struts application please it to me
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 |
What is the life cycle of actionform?
What is the purpose of @emailvalidator annotation?
Are the struts tags xhtml compliant ?
How can you create your custom interceptor in struts 2?
What are the steps used to setup dispatch action?
What is the purpose of struts.properties in struct2?
Is form beans are serializable or not?
11 Answers College School Exams Tests, Magna Infotech,
Can i use constructor in Action Class?If yes how?
which MVC architecture struts follows and why?
can we change the order of parameters in execute()?
Explain about struts dispatch action?
Why we use struts in java?