Struts Action:
1) Forward Action
Forward Action enables user to forward the specified URL in parameter.
Procedure:
Step_1:
Configure Struts-config.xml
Open Struts-config.xml
Include below code.
< action
parameter="”/jsp/Home.jsp"
path="”/Home”"
type="”org.apache.struts.actions.ForwardAction”" >
< /action >
Explain:
The control is forward to file that is specified in parameter attribute in action tag.
Step_2:
Create forward.jsp
Step_3:
Include below code in forward.jsp
< html:link action=”/Home” > Go to Home < /html:link >
Step_4:
Run forward.jsp
Right Click on forward.jsp . select Run file or shift+f6.
Note:
No need to create action class.
No comments:
Post a Comment