Configure DispatchAction into struts-config.xml

Configure DispatchAction into struts-config.xml

Previous Home Next

 

In this section, Create an action mapping for this action handler using the parameter attributes to specify the request parameter that carries the name of the method you want to invoke.

 The following configuration of DispatcherAction which are written in the struts-config.xml file:-

struts-config.xml


<?xml
version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> <struts-config> <form-beans > <form-bean name="UserForm" type="r4r.co.in.UserForm" /> </form-beans> <global-exceptions /> <global-forwards /> <action-mappings> <action input="/index.jsp" parameter="method" name="UserForm" path="/UserAction" scope="session" type="r4r.co.in.UserAction"> <forward name="success" path="/welcome.jsp" /> </action> </action-mappings> <message-resources parameter="com.yourcompany.struts.ApplicationResources" /> </struts-config>


Previous Home Next