Configure IncludeAction into struts-config.xml

Configure IncludeAction into struts-config.xml

Previous Home Next

 

We should be configure IncludeAction into struts-config.xml. You must create an action mapping when you want used IncludeAction The parameter attribute specifies the URL that will be included when the specified path is accessed.

Create IncludeAction mapping entries in the Struts configuration file:-

<action-mappings>
  <action path="/login"  type="org.apache.struts.actions.IncludeAction"  parameter="/login.jsp"/>
</action-mappings> 

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="loginForm" type="com.r4r.struts.LoginForm"/>
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="login" path="/login.do"/>
</global-forwards>
<action-mappings>
<action path="/login"  type="org.apache.struts.actions.IncludeAction"  parameter="/login.jsp"/>
<forward name="success" path="/success.jsp"/> <forward name="error" path="/error.jsp"/> </action> </action-mappings> <message-resources parameter="com.r4r.struts.ApplicationResources"/> </struts-config>


 

Previous Home Next