what we have done is pass the name of the calling action as a parameter in the JSP.
to do this we added a parameter as a hidden field. the action mapping is in request
scope when a JSP is rendered from a action's forward, so you can get the action
mapping's path and put it into the JSP hidden field. then when you submit the JSP to
the next action asking to go back to the calling page, the next action can do
something like:
return new ActionForward((String)request.getParameter("callingPage"));
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wed 8/6/2003 3:26 AM
To: [EMAIL PROTECTED]
Cc:
Subject: Still struggeling: howto get ActionForward to calling page
Hi,
i am still looking for a clean way to get an ActionForward to the page that
called my
current Action. That means e.g. I am a displayListAction and have been called
by a
selection screen. In case i don't find a result for the selection parameters I
would like to
bring a specific error to the calling selection screen. That would give users
a chance to
change their selection.
Sounding easy, this gets complicate in case there are several selection screens
bringing up the same list. I don't like to create a specific forward for each
selection page
and then somehow determine which one called me (can do that, but there should
be a
nice way in such a famous framework?).
The hint using
ActionMapping.getInputForward()
or new ActionForward(mapping.getInput())
didn't help me to much, seems to me there is hardcoded value inside, specified
in the
input attribute of the specific action.
How would an expert solve that problem?
:-) Alex
>Looking for a way to get an ActionForward to the page calling the
>current page.
>
>The example:
>Want to realize 5-XX pages where to enter values for a
>calculation. The calculation & result page would check if
>everything was fine (using db queries etc..)
>Now in case that one of the input values is incorrect /
>missmatching the context, I'd like to redisplay the calling page
>showing the values entered before + an error message.
>
>How can i realize that without having to define specific forwards
>to the 5 pages and then deciding which one was the calling one?
>
>Tried the ActionMapping.getInputForward(), but it brought back
>null values in the ActionForward only.
>
>Comments and keywords to look for welcome.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Learn more about Paymentech's payment processing services at www.paymentech.com
THIS MESSAGE IS CONFIDENTIAL. This e-mail message and any attachments are proprietary
and confidential information intended only for the use of the recipient(s) named
above. If you are not the intended recipient, you may not print, distribute, or copy
this message or any attachments. If you have received this communication in error,
please notify the sender by return e-mail and delete this message and any attachments
from your computer.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]