You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andras Balogh <an...@reea.net> on 2001/09/21 09:27:57 UTC

Using tag

Hi all,

I want to display an "update succesful" message in my jsp page.
I have in my action class the following:
ActionMessages messages=new ActionMessages();
 messages.add(ActionMessages.GLOBAL_MESSAGE,new 
ActionMessage("update.succesful.key"));
 saveMessages(request,messages);

I am not sure what to put in my JSP page.
I have tried <html:messages bundle="mybean">
but also an id is requried. What is this id?
The javadoc says:
"
protected void saveMessages(javax.servlet.http.HttpServletRequest request,
                            ActionMessages messages)
 
Save the specified messages keys into the appropriate request attribute 
for use by the <struts:messages> tag
 (if messages="true" is set), if any messages are required. Otherwise, 
ensure that the request attribute is not created."

Where should i set messages="true" ?

Can you give me an example? I have succesfully used the ActionErrors and 
i think that the messages should work too.