Thompson Marzagão wrote:
First, I apoligize for posting wrong lines of code, that <html:messages="removido"> wasnt at my code. Now I have this:Caro Vinicius,
Your java code is fine. But you got confused on the struts tags.
If you want to display ALL the messages you have, (that's probably what you need) one under the other, separated by <br>'s, you would use:
<html:messages id="message" message="true"> <bean:write name="message"/><br> </html:messages>
But if you only want to display that "removido" message when it exists, you can use:
<html:messages id="message" message="true" property="removido"> <bean:write name="message"/> </html:messages>
The html:messages tag loops over all of the items in your ActionMessages object.
The "id" is the label of the "current message instance" in the loop.
The "name" in the bean:write tag in this case corresponds to the label you gave to "current message instance".
Um abraco, Thompson
Vinicius Carvalho wrote:
I'm kinda lost with this. I set a message like below :
ActionMessages msgs = new ActionMessages();
msgs.add("removido", new ActionMessage("br.com.auge.bancoprojetos.registroRemovido"));
saveMessages(request,msgs);
Than I want to display it:
<logic:messagesPresent> <html:messages="removido"> </html:messages> </logic:messagesPresent>
That's not working anyway....
I'm kinda lost with id and name as well, which one is which??
Thanks
--------------------------------------------------------------------- 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]
<html:messages message="true" id="message"> <bean:write name="message"/><br> </html:messages>
And it says that can not find bean message in any scope, which makes sense once I don't recall myselft setting the messages name to message.
Anyway, what does this do?
ActionMessages msgs = new ActionMessages();
msgs.add("removido", new ActionMessage("br.com.auge.bancoprojetos.registroRemovido"));
saveMessages(request,msgs);
cuz, anywhere I set a name for my messages....
Thanks
Vinicius
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]