On Tue, Jun 2, 2009 at 11:32 PM, Aaron Porter <[email protected]> wrote:
> Hi James,
> On a forward the original request info is stuffed into attributes. You
> can find the details here:
>
> http://nlc.nlc.go.cn/resin-doc/webapp/faq.xtp#forward
Thank you. That put me on the right path. It seems that in my "jsp
forwards to action forwards to jsp" setup, if I request the attribute
in the latter jsp, I actually get the url of the actionbean rather
than of the first jsp. The solution I came up with was to stash the
original url as soon as the context was set in my common ActionBean
base class:
thanks.
public abstract class BaseActionBean implements ActionBean {
private String originalUrl;
private ActionBeanContext ctx;
private LoginInfo login;
public ActionBeanContext getContext() { return ctx; }
public void setContext(ActionBeanContext ctx) {
this.ctx = ctx;
setOriginalUrlFromContext();
}
public LoginInfo getLogin() {
if (login == null){
login = new LoginServiceImpl().login(getOriginalUrl());
}
return login;
}
public void setLogin(LoginInfo login) {
this.login = login;
}
public String getOriginalUrl() {
return originalUrl;
}
public void setOriginalUrl(String callingUrl) {
this.originalUrl = callingUrl;
}
public void setOriginalUrlFromContext() {
originalUrl =
(String)ctx.getRequest().getAttribute("javax.servlet.forward.request_uri");
if (originalUrl == null){
originalUrl = ctx.getRequest().getRequestURI();
}
}
}
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users