You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Travis Stevens <Tr...@noaa.gov> on 2003/07/28 18:47:11 UTC
messages 101
I can't seem to get messages to work. My action code has this line of code:
//create a message
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage("record.save.success",new Integer(record.getUID())));
this.saveMessages(request,messages);
//log it
if (log.isInfoEnabled()){
log.info("Record saved successfully:" + record.getUID());
}
and my view has this:
<html:messages id="error">
<bean:write name="error"/><br />
</html:messages>
and my struts-config has:
<message-resources parameter="gov.noaa.mm.NMMRResources"/>
Nothing prints out in my view. What am I missing here? The log message
"Record saved successfully" shows up, so I know that the messages are
being saved. My ActionErrors work fine so I know my message-resources
are being used properly.
The javadoc for Action.saveMessages() reads:
Save the specified messages keys into the appropriate request attribute
for use by the <html:messages> tag (if messages="true" is set), if any
messages are required.
Is this my problem? Do I have to set messages to "true". Where do I
set messages="true"?
thanks,
-Trav
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org