wood burning stoves
The moose likes Struts and the fly likes jsp:forward vs logic:forward Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "jsp:forward vs logic:forward" Watch "jsp:forward vs logic:forward" New topic

jsp:forward vs logic:forward

Marco Vanoli
Ranch Hand

Joined: Jan 12, 2005
Posts: 99
Waht is the difference between to use
<jsp:forward page="default.do"/>
(default.do is an action forward than point to my.jsp )


<logic:forward name="welcome"/>

(welcome is a global forward that point to action default.do)

Wich is the right tag to use ?

bye, <br />Marco
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Here are the reference urls:



It looks like the main difference is that logic:forward will perform a redirect if you've already written to the output buffer and it's too late to forward.

In my opinion, though, I can't think of a good reason to do a forward from a JSP. The Action class should do the forwarding.

Consultant, Sima Solutions
sweety Ktv

Joined: Jan 11, 2012
Posts: 1
jsp:forward does not check for the path in struts-config.xml, it directly forwarded to the page

logic:forward checks for the name in <global-forwards> of struts-config.xml
I agree. Here's the link: http://aspose.com/file-tools
subject: jsp:forward vs logic:forward
jQuery in Action, 3rd edition