Hi,
We have implemented something similar in our project.
To implement internationalisdation , we do the same.
On every page,there is a link t every languiage supported(French,German etc.).
So when the user clicks on the language link, the same action is called but before
that another action changes the locale for the users session.
So i think , some thing similar u can use which is already suggecsted by somebody to
you.
But the way we do this is different than what has been suggested so far.
We store the action to forward to as LAST_ACTION_CALLED in session.But we do the
following so that all the actoion as well as the query parameters are stored..
/**
* A method which saves the URL of this action in Session so that
* the same can be used for rendering the same page again
*/
private void saveActionURL(HttpServletRequest request) {
String context = request.getContextPath();
StringBuffer url = new StringBuffer(request.getRequestURI());
Map map = request.getParameterMap();
if( map.size() > 0 ){
url.append("?");
Iterator it = map.keySet().iterator();
while(it.hasNext()){
String param = it.next().toString();
url.append(param);
url.append("=");
url.append( request.getParameter(param) );
if( it.hasNext() ){
url.append("&");
}
}
}
String urlString = null;
int start = url.indexOf(context);
if (start != -1) {
urlString = url.substring(start + context.length());
}
if (urlString.startsWith("/")){
urlString = urlString.substring(1);
}
Logger.debug(this, "Action is : " + urlString);
request.getSession().setAttribute(
WebStringConstants.LAST_ACTION_CALLED,
urlString);
}
and then u can use the same to foreward to..
Hope this helps.
regards.
Shirish
-----Original Message-----
From: Jeff Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 6:15 PM
To: Struts Users Mailing List
Subject: Re: [Q] Return-to-page - is there a slick solution?
> From: "Ian Hunter" <[EMAIL PROTECTED]>
> From the main page, I have the option for each user to "ask" for
membership
> in any group they don't currently belong in. They can hit one button that
> forwards to a different action (groupinterest.do), with a forward called
> "returnto" set to the main page. That action calls the exact same class
as
> updategroup.do, but that class knows to look for a forward called
"returnto"
> and either return to it or "pass it along" by storing it as a session
> variable. When I do that, I store the entire ActionForward object, not
just
> the page name, so I catch requests to redirect as well as any other
strange
> config details of that forward.
So, if I follow this (and I'm not sure I do - either too much coffee or not
enough :-) you've created an "indirection" step in your sequence that knows
where to jump back to. I understand the part about tracking the entire
ActionForward so that you pick up all the nuances of the forward params.
Having re-read my posting, I realize I might not have been clear on one of
the problem points - there are dozens of pages from which my user may choose
to start this sequence. Doesn't your solution require a separate
"indirection" step for each potential starting point - in order to code the
approprite returnto forward?
But you raise a very good point, that David's suggestion (simply caching the
originating page name at sequence start time) doesn't address - capturing
the nuances of the returnto page forward, such as redirect=true/false or
perhaps even URL parameters.
Jefficus
---------------------------------------------------------------------
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]