I hope to be not too much oot :-) I would even say that the forward is internal to the server (ie, no client/server communication) but the redirect is a http response to the client. The forward is sometimes used to separate the business logic (p.ex : a servlet) from the presentation (p.ex : a jsp). A problem can be if the servlet and the jsp sit in different directories. For example : a client accesses a servlet in x.com/servlet/frontcontroller that forwards to /gui/screen1.jsp. The client's path is still x.com/servlet/frontcontroller since the forward is internal. If the jsp needs to get a picture in /gui/image.gif then the html must look like <img src="../gui/image.gif"> even if the jsp and the image are in the same directory.
The redirect can be used for non-existing pages (p.ex : x.com -> x.com/index.html), but there are other uses probably... A forward cannot go out of the application server since it is internal. The application server is not a proxy... Have a look at HttpRequest.getDispatcher(...) and HttpResponse.sendRedirect(...). Kind regards, Andr� -----Original Message----- From: Simon Kelly [mailto:[EMAIL PROTECTED] Sent: 14 March 2003 11:44 To: Struts Users Mailing List Subject: Re: [XEN] Simple question: forward and redirect When you forward, you pass control to another class within your current application root context. When you redirect, you can pass in or out of the context. Simon - "If I have this wrong, my site is well sha***d!!" ----- Original Message ----- From: "Fabio Mancinelli" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, March 14, 2003 11:28 AM Subject: [XEN] Simple question: forward and redirect > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Thu, 13 Mar 2003, Ian Hunter wrote: > > > Are you redirecting or forwarding to your JSP from that Action? > > What is the exact difference between forwarding and redirecting? What are > their implications? > > I searched the Servlet and JSP specs but I haven't found nothing about > that. > > A presto, > Fabio > > - -- > - ------------------------------------------------------------------------ ----- > Fabio Mancinelli, PhD student EMail : [EMAIL PROTECTED] > Dipartimento di Informatica WWW : http://www.di.univaq.it/~mancinel > Universita' dell'Aquila > - ------------------------------------------------------------------------ ----- > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: Made with pgp4pine 1.75-6 > > iD8DBQE+ca7A6dsQbk2R3cMRAruyAKDTfVtCqtF13uyg+oDHw8NpfSIWrgCfa8RB > FKSGdLso4sReqYrbCO2fkcE= > =aSQr > -----END PGP SIGNATURE----- > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **** DISCLAIMER **** "This e-mail and any attachments thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by persons other than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer. Thank you for your cooperation." --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

