Tuesday, January 8, 2013

STRUTS FORWARD EXAMPLE


                                                      STRUTS FORWARD
We created a basic struts project before and now we will route it to the jsp we will define. Importants are these :
1 ) Action class mapping process
2 ) Config file forward tag
3 ) jsp

In the action class we returned null before and now we will return different such as :
return mapping.findForward("forward1");

Now it will route with the parameter forward1

struts config xml


<forward name="forward1" path="/forward1.jsp"></forward>

now the forward1 parameter will be handled by forward name attribute and the path will be executed.

your forward1.jsp under the WebContent of your project or webapp whatever you named that folder will be executed.



No comments:

Post a Comment