• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp:forward vs logic:forward

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Waht is the difference between to use
<jsp:forward page="default.do"/>
(default.do is an action forward than point to my.jsp )

and

<logic:forward name="welcome"/>

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

Wich is the right tag to use ?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are the reference urls:

http://struts.apache.org/userGuide/struts-logic.html#forward

http://java.sun.com/products/jsp/tags/11/syntaxref11.fm9.html

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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic