struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Stranathan <w...@thestranathans.com>
Subject Re: Action Returning to previous page
Date Thu, 20 Jan 2005 03:02:48 GMT
Not positive I completely understand the question, so I'll make a very 
vague response.

You can:
1) Use the input attribute of an Action to specify the page that fed 
it - if the validate() method on the ActionForm() returns a non-empty 
ActionErrors, the user will go back there.
2) Specify a <forward /> for the Action that sends the user back to 
from whence they came.
3) Use request.getHeader("referer") to find out the page that got you 
here.  But you need to be careful - it's NOT mandatory for a client to 
send this header.  And you won't be able (AFAIK) to return a proper 
ActionForward for it - you'll just have to redirect the request and 
return null.

w

On Wed, 19 Jan 2005 21:51:10 -0500
  Brandon Mercer <brandon@eutonian.com> wrote:
>Is there a way to have an action return to the page that it was 
>submitted from?  This is what I have and what I'd like to do:  I've 
>got a page that has a template in it for looking up account numbers. 
> This template goes in EVERY page in my application.  I also have 
>other pages that perform specific information for a particular 
>account that gets pulled up.  What I'd like to be able to do is be 
>working on a page, lets say, cash transactions and then pull up 
>another account using my search template so that the result populates 
>into that page.  Any good ways to do this are welcome, thanks guys,
>Brandon
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>


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


Mime
View raw message