This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
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=""/>
( is an action forward than point to my.jsp )


<logic:forward name="welcome"/>

(welcome is a global forward that point to action

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
subject: jsp:forward vs logic:forward