Struts ActionMessage -
hi have struts 1.x app, , in order show errors detected in action class, use:
errors.add("error global", new actionmessage("some_string_in_properties_file"));
which works fine.
my problem string need send jsp page error has session variable in (like "you have 3 more valid attempts", being 3 session variable).
how can accomplish ?
thanks.
try use actionmessage constructor of 2 arguments. according javadoc:
public actionmessage(java.lang.string key, java.lang.object value0) construct action message specified replacement values. parameters: key - message key message value0 - first replacement value
in case:
errors.add("error global", new actionmessage("some_string_in_properties_file", sessionvariable));
some_string_in_properties_file
should this:
some_string_in_properties_file=you have {0} more valid attempt(s)
Comments
Post a Comment