You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joachim Martin <jm...@hbs.edu> on 2002/02/13 16:57:59 UTC
how does ActionForm get a MessageResources object?
I'm using the Nightly Build.
ActionServlet.getResources() is deprecated:
Actions should call Action.getResources(HttpServletRequest)
instead of this method, in order to retrieve the resources for
the current sub-application.
I am trying to use the MessageResources object to add an
error in an ActionForm.validate() using the property's label, instead
of hard-coding it:
errors.add(property,
new ActionError("errors.required", resources.getMessage("mainMenu." +
property)));
Is there any way for an ActionForm to use the nice MessageResource feature
of Struts?
Thanks --Joachim