Perhaps you should be using <h:errors> to display your error messages
instead of <h:messages>
I think it depends on if you use saveErrors or saveMessages in your Action.
K.C.
Les Dunaway wrote:
I am having problems with Struts 1.2.4 ActionMessage / ActionError.
I'm using a setup like recommended on the wiki
ActionMessages am = new ActionMessages();
am.add( ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
"not.authorized.for.account" ) );
saveErrors( request, am );
<html:messages id="msg" message="false">
<bean:write name="msg" />
</html:messages>
My code:
LogonAction:
ActionMessages errors = new ActionMessages();
if(!ud.isUserExist(username)){
errors.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("error.logon.invalid.user"));
log.debug("Invalid User: " + username + " Errors: " +
errors.toString());
Logon.jsp
<h:messages id="msg" message="false">
<b:write name="msg" />
</h:messages>
Log4j from above: 102383
[http-8084-Processor42] DEBUG us.glsi.base.LogonAction - Invalid
User: ferd Errors:
{org.apache.struts.action.GLOBAL_MESSAGE=[error.logon.invalid.user[]]}
I'm getting "2005-04-14 07:31:14
StandardWrapperValve[action]: Servlet.service() for servlet action
threw exception
javax.servlet.jsp.JspException: Cannot find bean msg in any scope"
That says to me that the html:messages tag is seeing that there are
messages (and
there are, I can see that in my log4j output) and then the bean:write
tag isn't
seeing the msg bean that the messages tag should have created?? Right?
What am I messing up?
Les
------------------------------------------------------------------------
L.W.(Les) Dunaway
GL Services
770-974-4289 / 888-243-9886
[EMAIL PROTECTED]
"Great minds discuss ideas. Average minds discuss events. Small minds
discuss people." - Admiral Hyman Rickover
------------------------------------------------------------------------
---------------------------------------------------------------------
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]