Question

I want to display errors detected in an action class, I use:

errors.add(ActionErrors.GLOBAL_MESSAGE,
  new ActionMessage("some_string_in_properties_file"));`

and it works fine. However, I have written some generic error messages, and I would like to reuse them, so I am trying to do this:

errors.add(ActionErrors.GLOBAL_MESSAGE,
  new ActionMessage("string1_in_properties_file", "string2_in_properties_file"));

where string1 = <li>{0} is required.</li>.

Then it is displaying string2 is required. It is not replacing string2 with its value.

I even tried

errors.add(ActionErrors.GLOBAL_MESSAGE,
  new ActionMessage("string1_in_properties_file",
  new ActionMessage("string2_in_properties_file")));

then it is displaying string2[] is required. It is not replacing string2.

I know it can be done by hard-coding the value, but is there any other way?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top