struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ian_d_stew...@bankone.com
Subject RE: newbiew Q: how to do redirect instead of forward
Date Thu, 05 Jun 2003 20:54:45 GMT


Ok.  So, from the user's perspective, when we do a redirect, they are sent
to a different location.  When we do a forward, they are not, even if the
content changes?

Ian D. Stewart
Open Systems Engineer II
Enterprise Midrange - Bank One Infrastructure & Operations
ian_d_stewart@bankone.com
(614) 213-6100




"Brandon Goodin" <mail@phase.ws> on 06/05/2003 04:48:43 PM

Please respond to "Struts Users Mailing List"
      <struts-user@jakarta.apache.org>

To:   "Struts Users Mailing List" <struts-user@jakarta.apache.org>
cc:

Subject:  RE: newbiew Q: how to do redirect instead of forward



1) You need to set your forward redirect="(true|false)" in your
struts-config.xml for that particular action mapping.
2) The difference...
a) "redirect" generates a whole new request by sending a header back to the
client you lose all of your request scope data.
b) "forward" continues with the same request and arrives at the view with
request object intact.

RequestDispatcher vs response.redirect();

Brandon Goodin

-----Original Message-----
From: ian_d_stewart@bankone.com [mailto:ian_d_stewart@bankone.com]
Sent: Thursday, June 05, 2003 2:37 PM
To: Struts Users Mailing List
Subject: Re: newbiew Q: how to do redirect instead of forward




This is probably a silly question, but what's the difference between
forward and redirect?


Thanx,
Ian

Ian D. Stewart
Open Systems Engineer II
Enterprise Midrange - Bank One Infrastructure & Operations
ian_d_stewart@bankone.com
(614) 213-6100




"Zhu He" <hez@cisco.com> on 06/05/2003 04:16:07 PM

Please respond to "Struts Users Mailing List"
      <struts-user@jakarta.apache.org>

To:   <struts-user@jakarta.apache.org>
cc:

Subject:  newbiew Q: how to do redirect instead of forward



for forward we usually do
execute() {
    ...
    return mapping.findForward("listing");
}

I tried to use redirect by
execute() {
      ActionForward af = mapping.findForward("listing");
      af.setRedirect(true);
      return af;
}

but get exception
javax.servlet.ServletException: Configuration is frozen
     at
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.

java:541)

     at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces

sor.java:482)

     at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)


     at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)








This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this transmission
in error, please immediately contact the sender and destroy the material in
its entirety, whether in electronic or hard copy format. Thank you.


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



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









This transmission may contain information that is privileged, confidential and/or exempt from
disclosure under applicable law. If you are not the intended recipient, you are hereby notified
that any disclosure, copying, distribution, or use of the information contained herein (including
any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error,
please immediately contact the sender and destroy the material in its entirety, whether in
electronic or hard copy format. Thank you.


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


Mime
View raw message