struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David G. Friedman" <hum...@ix.netcom.com>
Subject RE: Why Struts use "forward" instead of "redirect" to "jump" from one JSP to another?
Date Sat, 02 Oct 2004 18:53:48 GMT
Chris,

A struts forward is an internal handoff, unless redirect="true", allowing
the next page, JSP, etc. to have full knowledge of anything submitted with
the HTTP GET or POST page request.  This allows the JSP/page to have full
use of the form (which is usually in request scope) and any objects the
action may have saved in the request scope.

If all display changes were redirects, you would have to put anything you
need to keep into session or application scope and figure out a way to clean
them up when you were done with them so your session objects would remain
within reasonable size limits.  I've read that after the session scope
reaches a certain size, containers such as Tomcat begin having performance
problems.

It can also provide additional security.  I say this because some pages are
safe to have publicly accessible but others are better left hidden, such as
ones related to modifying databases.  After all, it is often easier to use
Struts role authentication to manage access to a JSP than to add JSTL tags
or use taglibs to lock down portions of a JSP.  I tried it once and found it
made for a very messy and difficult to read JSP.  Using a forward, you can
put a JSP in the private /WEB-INF/ folder under a directory of your
choosing, such as /WEB-INF/pages and the client will not be able to access
those critical pages directly - not without going through your Struts
actions/authentication first.  All because forwards are usually internal
handoffs that the client and his/her browser are never aware of.

I hope this point of view helps. :)

Regards,
David

-----Original Message-----
From: Chris [mailto:jakarta-struts-usr@SoftHome.net]
Sent: Saturday, October 02, 2004 1:27 PM
To: Struts Users Mailing List
Subject: Why Struts use "forward" instead of "redirect" to "jump" from
one JSP to another?


Hi , all

I am wondering why Struts use "forward" instead of  "redirect"
to "jump" from one JSP to another.

Could anybody give me some hint?

Regards
Chris




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message