This content has been marked as final.
Show 6 replies
-
1. Re: Authenticator Action dynamic error message
tmalatinszki Oct 13, 2009 1:33 PM (in response to bashan)Hi Guy,
Yes, You can
manipulate
Your error messages this way:if(badPassword==true){ FacesMessages.instance().getCurrentMessages().clear(); FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, "Bad password!"); } else if(badUserName==true){ FacesMessages.instance().getCurrentMessages().clear(); FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, "Bad username!"); }
Regards,
Tamas
-
2. Re: Authenticator Action dynamic error message
bashan Oct 13, 2009 1:44 PM (in response to bashan)Great. Thanks!
-
3. Re: Authenticator Action dynamic error message
bashan Oct 13, 2009 11:45 PM (in response to bashan)Hi Tamas,
I'm afraid your solution doesn't work. That's it because I add the error message in the Authenticator bean itself, at that stage clearing the messages doesn't help much, since the error of invalid login is added automatically by Seam only AFTER returning from the authenticator method.
Do you have a suggestion?
Thanks,
Guy. -
4. Re: Authenticator Action dynamic error message
wilczarz.wilczarz.gmail.com Oct 14, 2009 10:18 AM (in response to bashan)I suppose you can configure it in pages.xml:
<exception class="org.jboss.seam.security.AuthorizationException"> <redirect view-id="/unauthorized.xhtml" > <message>#{messages[ foo.bar ? 'foo' : 'bar' ]}</message> </redirect> </exception>
-
5. Re: Authenticator Action dynamic error message
tmalatinszki Oct 14, 2009 1:23 PM (in response to bashan)In this case You can throw a new AuthorizationException like this:
if(badPassword==true){ FacesMessages.instance().clear(); throw new AuthorizationException("Bad password!"); } else if(badUserName==true){ FacesMessages.instance().clear(); throw new AuthorizationException("Bad username!"); }
Regards,
Tamas
-
6. Re: Authenticator Action dynamic error message
bashan Oct 17, 2009 1:07 AM (in response to bashan)Nope, this one also doesn't work.
I am just getting this error message:Transaction failed
.