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

2003-06-07 Thread Vic Cekvenich
Here is one example of a back button solution I plan to implment.

http://www.robertpenner.com/experiments/backbutton/backbutton_code.html

Try it.

.V

Craig R. McClanahan wrote:

On Fri, 6 Jun 2003, Steve Raeburn wrote:

 

Date: Fri, 6 Jun 2003 22:32:04 -0700
From: Steve Raeburn [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: newbiew Q: how to do redirect instead of forward
   

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
I've also been known to create web applications that open the app in a new
window without these things -- it doesn't stop the advanced user who knows
the keyboard shortcuts from trying to screw things up, but it sure cuts
down on the unsophisticated users who think a web application is supposed
to be browsable the same way that a web site is :-).
 

G! Craig, *you're* the one who's been doing that to me all this time.

I hope you don't try to stop users viewing the page source by disabling the
right mouse click. ;-)
   

Show me the back button on an app built with Swing, or even with something
like MFC, and I will relent :-).
If users complain that they need the back button, that's a pretty good
clue that you have not defined enough useful navigation controls inside
your application window.  But that's a usability issue, not a
technological issue.
 

Steve
   

Craig
 

--
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA
Advanced a href =baseBeans.comStruts Training/a and project recovery in North 
East.
Open Source a href =baseBeans.comContent Management/a  basicPortal sofware
Best practicea href =baseBeans.comStruts Support/a v.1.1 helper ScafflodingXPress



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

2003-06-07 Thread Mark Galbreath
hey man, discuss this real-time at irc.darkmyst.org 6667!  If you need a
client, get it at www.mirc.com.

mark

-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 07, 2003 10:46 AM
To: [EMAIL PROTECTED]
Subject: Re: newbiew Q: how to do redirect instead of forward


Here is one example of a back button solution I plan to implment.

http://www.robertpenner.com/experiments/backbutton/backbutton_code.html

Try it.

.V

Craig R. McClanahan wrote:

On Fri, 6 Jun 2003, Steve Raeburn wrote:

  

Date: Fri, 6 Jun 2003 22:32:04 -0700
From: Steve Raeburn [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
 [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: newbiew Q: how to do redirect instead of forward




-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]

I've also been known to create web applications that open the app in 
a new window without these things -- it doesn't stop the advanced 
user who knows the keyboard shortcuts from trying to screw things up, 
but it sure cuts down on the unsophisticated users who think a web 
application is supposed to be browsable the same way that a web site 
is :-).
  

G! Craig, *you're* the one who's been doing that to me all this 
time.

I hope you don't try to stop users viewing the page source by 
disabling the right mouse click. ;-)




Show me the back button on an app built with Swing, or even with 
something like MFC, and I will relent :-).

If users complain that they need the back button, that's a pretty good 
clue that you have not defined enough useful navigation controls inside 
your application window.  But that's a usability issue, not a 
technological issue.

  

Steve



Craig
  


-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced a href =baseBeans.comStruts Training/a and project recovery
in North East. Open Source a href =baseBeans.comContent Management/a
basicPortal sofware Best practicea href =baseBeans.comStruts Support/a
v.1.1 helper ScafflodingXPress





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Jimmy Emmanual
Try building the whole forward from scratch.

ActionForward forward = new ActionForward();

forward.setPath(/newrequest/index.jsp);   

forward.setRedirect(true);
forward.setContextRelative(true);

return forward;

Jimmy


-Original Message-
From: Zhu He [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 4:16 PM
To: [EMAIL PROTECTED]
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)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread ian_d_stewart


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
[EMAIL PROTECTED]
(614) 213-6100




Zhu He [EMAIL PROTECTED] on 06/05/2003 04:16:07 PM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
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(RequestProcessor.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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Brandon Goodin
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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
[EMAIL PROTECTED]
(614) 213-6100




Zhu He [EMAIL PROTECTED] on 06/05/2003 04:16:07 PM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Zhu He
b)  plus the addressbar doesn't change.
this sometimes causes problem, for example starting from a fowarded page,
you go to another webpage, then go back you will not get the same page.

Zhu
- Original Message -
From: Brandon Goodin [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 4:48 PM
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 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
 [EMAIL PROTECTED]
 (614) 213-6100




 Zhu He [EMAIL PROTECTED] on 06/05/2003 04:16:07 PM

 Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

 To:   [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 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]



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

2003-06-06 Thread Jimmy Emmanual
When you redirect, the RequestDispatcher tells the browser to request
another URL. When this happens there is always a round trip to the client
side and the previous Request and Response objects are lost. Also, redirect
allows you to request a resource outside the current application.

In a forward, the request is done w/o the help of the client browser. Also,
the Request and Response objects are kept.

Jimmy

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 4: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
[EMAIL PROTECTED]
(614) 213-6100




Zhu He [EMAIL PROTECTED] on 06/05/2003 04:16:07 PM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread ian_d_stewart


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
[EMAIL PROTECTED]
(614) 213-6100




Brandon Goodin [EMAIL PROTECTED] on 06/05/2003 04:48:43 PM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]

To:   Struts Users Mailing List [EMAIL PROTECTED]
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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
[EMAIL PROTECTED]
(614) 213-6100




Zhu He [EMAIL PROTECTED] on 06/05/2003 04:16:07 PM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]









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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Zhu He

 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?
The content changes to the content of the new page, but address bar stays
the same because all the forwarding is done on the server side.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Craig R. McClanahan


On Thu, 5 Jun 2003 [EMAIL PROTECTED] wrote:

 Date: Thu, 5 Jun 2003 16:54:45 -0400
 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: RE: newbiew Q: how to do redirect instead of forward



 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?

You've got it.  Essentially, the URL that is requested addresses a piece
of business logic (save this customer or search this database) -- it
has nothing at all to do with which page actually produces the output.
Internally, the application implements this with a
RequestDispatcher.forward() call, which is essentially like calling a
subroutine -- the client has no clue who really provided the response.

I'm something of a rebel in this regard, but I believe that the location
bar and the back button are the two worst features of HTML browsers.  In a
Model 2 design architecture like the one that Struts advocates, URLs are
basically irrelevant to users -- it's just a feature of the plumbing used
to enable the application to execute.

I've also been known to create web applications that open the app in a new
window without these things -- it doesn't stop the advanced user who knows
the keyboard shortcuts from trying to screw things up, but it sure cuts
down on the unsophisticated users who think a web application is supposed
to be browsable the same way that a web site is :-).

Craig McClahan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Steve Raeburn

 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]

 I've also been known to create web applications that open the app in a new
 window without these things -- it doesn't stop the advanced user who knows
 the keyboard shortcuts from trying to screw things up, but it sure cuts
 down on the unsophisticated users who think a web application is supposed
 to be browsable the same way that a web site is :-).

G! Craig, *you're* the one who's been doing that to me all this time.

I hope you don't try to stop users viewing the page source by disabling the
right mouse click. ;-)

Steve




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2003-06-06 Thread Craig R. McClanahan


On Fri, 6 Jun 2003, Steve Raeburn wrote:

 Date: Fri, 6 Jun 2003 22:32:04 -0700
 From: Steve Raeburn [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
  [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: RE: newbiew Q: how to do redirect instead of forward


  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
 
  I've also been known to create web applications that open the app in a new
  window without these things -- it doesn't stop the advanced user who knows
  the keyboard shortcuts from trying to screw things up, but it sure cuts
  down on the unsophisticated users who think a web application is supposed
  to be browsable the same way that a web site is :-).

 G! Craig, *you're* the one who's been doing that to me all this time.

 I hope you don't try to stop users viewing the page source by disabling the
 right mouse click. ;-)


Show me the back button on an app built with Swing, or even with something
like MFC, and I will relent :-).

If users complain that they need the back button, that's a pretty good
clue that you have not defined enough useful navigation controls inside
your application window.  But that's a usability issue, not a
technological issue.

 Steve

Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]