[
https://issues.apache.org/jira/browse/JSPWIKI-691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031741#comment-13031741
]
Juan Pablo Santos RodrÃguez commented on JSPWIKI-691:
-----------------------------------------------------
I got why errors aren't carried over between Login and Message actionbeans:
they're bound to them (more precisely, validation errors are bounded to the
ActionBeanContext of the ActionBean instance, cfr. with
http://osdir.com/ml/java.stripes.user/2006-10/msg00256.html), whereas messages
are passed through FlashScope.
For this particular case, placing a breakpoint at the beggining of
WikiInterceptor.intercept() method, when context.getLifecycleStage() ==
LifecycleStage.RequestComplete shows the validation error in LoginActionBean
but not in MessageActionBean.
As to where stash the error message, I think the cleaner way would be, on
LoginActionBean:
{noformat}
public Resolution view()
{
// If user got here and is already authenticated, it means
// they just aren't allowed access to what they asked for.
// Weepy tears and hankies all 'round.
if( getContext().getWikiSession().isAuthenticated() )
{
String accessDenied = new LocalizableError( "login.error.noaccess"
).getMessage( getContext().getRequest().getLocale() );
return new ForwardResolution( MessageActionBean.class ).addParameter(
"message", accessDenied );
}
{noformat}
> Navigation to ./admin/Admin.jsp with a non-authorized user redirects to a
> blank ./Message.jsp
> ---------------------------------------------------------------------------------------------
>
> Key: JSPWIKI-691
> URL: https://issues.apache.org/jira/browse/JSPWIKI-691
> Project: JSPWiki
> Issue Type: Bug
> Affects Versions: 3.0
> Reporter: Juan Pablo Santos RodrÃguez
> Priority: Minor
>
> Navigation to ./admin/Admin.jsp with a non-authorized user redirects to a
> blank ./Message.jsp, whereas in 2.8 you're redirected to error screen.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira