I am new to struts. Can somebody explain to me the difference between forward and type attributes of action element in struts-config.xml. In books it is written type is used when we want to use an action and forward when we donot want an action to happen.But i want to know when should i use type and when forward in building a project..They seem to do the same job.What is the actual difference.
I am confused. [ December 18, 2005: Message edited by: subho saha ]
My view of this is that in almost every case, you will use Type instead of Forward. Using Type causes struts to call your action before forwarding to a JSP. In a real application, there is almost always some processing you want to do before displaying a JSP.
About the only thing I use the forward option for is when I have a simple jsp that requires no setup to display, but I don't really want the user to see xyz.jsp as the url on the browser. So, I set up an xyz action that forwards to xyz.jsp. That way the user sees xyz.do as the url on the browser. [ December 18, 2005: Message edited by: Merrill Higginson ]