[Logo]
Forums Register Login
Messages displayed only if I use saveErrors()
I have different types of messages to display to the user - errors, confirmations etc.

This is what I use in my action:


This is what I use for displaying the messages:


The problem is that no messages are displayed. If I change saveMessages() to saveErrors(), it works, but I want to use saveMessages() as I have messages to display other than errors.

I am using Struts 1.3.10.
You would need to add messeage="true" to your html:messages:

<html:messages id="error" property="errors" messeage="true">
Thank you! It works.

I should have payed more atention to the tag documentation, the answer was there.
So, by default, it reads the messages from the request attribute named Globals.ERROR_KEY, and setting the "message" to "true" makes the tag read from Globals.MESSAGE_KEY.

Unfortunately, this brings another problem:
- saveMessages() saves to Globals.MESSAGE_KEY
- saveErrors() saves to Globals.ERROR_KEY
- the messages returned by an ActionForm.validate() will be saved to Globals.ERROR_KEY

So I have to do this to display all messages:

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 17, 2017 14:30:20.