I have 2 or 3 ways:

The first is to place a boolean value into the request/session from your
summary Action and check for it in your JSP, something like
cameFromSummaryPage="true".  Or you can put a request type variable in the
request/session to check instead, something like requestType="Summary" or
requestType="init", you know?

If you're looking for something more generic to be used with all your JSPs,
you could add a hidden field to every form which contains the page name or a
logical identifier for the page.  Every ActionForm would have a field to
contain this value.  So, you have a hidden field with these pairs:
name="pageName" value="mySummaryPage.jsp".  Then you just have a field (with
getter/setter) named "pageName" in every ActionForm as well, and voila,
every ActionForm now knows what page it was invoked from.  You can easily
check these values from your JSP and take action accordingly.

Of course, you can get the URI for the last request from the ActionMapping
and store that in the form bean, too, and use it as the identifier for your
JSPs.  It's up to you.

happy coding,

Joe

> -----Original Message-----
> From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 10:40 AM
> To: Struts Users Mailing List
> Subject: RE: mapping
>
>
> I keep that to myself, if you know how to do it, I'd appreciate
> your answer
> and help, otherwise thanks!
>
> Carlos Fernandez
> www.s1.com
>
> -----Original Message-----
> From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 1:09 PM
> To: 'Struts Users Mailing List'
> Subject: RE: mapping
>
>
> Why do you need to know which page invokes the data entry page?
>
> -----Original Message-----
> From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 12:00 PM
> To: Struts
> Subject: mapping
>
>
> Hi There,
>
> Can someone tell me the best way to know which page I am coming from?. I
> have a clue using mapping object in the action class. This is the
> scenario :
> The first page is a data entry one. Once you put the fields you click
> continue and go to the summary one that will ask to confirm the
> values just
> entered. This second page has two buttons "edit" and "continue".
>
> If I click "edit" button, I have to come back to the first page with the
> values I entered before in the fields. The question is : The
> first page gets
> invoked from two different pages....the previous one (that invokes it the
> first time) and from the summary one. I need to know which page
> invoked it.
> Any ideas?
>
> Carlos Fernandez
> www.s1.com <http://www.s1.com>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>


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

Reply via email to