Hi,

I think I've found a bug within Struts2 related to
ServletActionRedirectResult/ServletRedirectResult. We have a custom
ActionMapper, which is based on DefaultActionMapper. One of the differences
between the two is that our implementation of getUriFromActionMapping()
sometimes returns values without a / on the front. This results in an NPE
during our login process.

Login is setup like this:

o Login.jsp submits to LoginAction o On a successful login, LoginAction
redirects (via a "redirect-action" result in struts.xml) to HomeAction. o
HomeAction redirects to different actions based on the logged in users role.

An NPE is thrown when trying to redirect after HomeAction.execute() returns.
The NPE occurs in ServletRedirectResult.java at line 127. It is thrown because
actionMapper is null. The ActionMapper isn't being injected into
ServletRedirectResult via setActionMapper(). I'm guessing this is because
ServletRedirectResult.doExecute() is being called from
ServletActionRedirectResult (via super.execute()), as opposed to the framework
creating a new instance. I was able to fix it by removing the actionMapper
instance from ServletActionRedirectResult.java, and making
ServletRedirectResult's actionMapper protected instead of private. I not sure
if this really a valid fix. Our custom mapper includes the changes made in
DefaultActionMapper to fix WW-1571, so I think this may be a separate issue.

Thanks!




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

Reply via email to