You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Linnéa Ahlbeck <li...@appium.com> on 2003/01/21 15:38:50 UTC

Find message resources file from form bean (validate) - method depricated!

Hi!

I have a problem finding a new way to find my resources file from the form
bean.
The code I have been used so far in my validate method is the following:


public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
      ActionErrors errors = new ActionErrors();
      UCUser user = (UCUser)
request.getSession().getAttribute(Constants.MY_UCUSER);
      TelephoneNumberFormat telephoneNumberFormat =
TelephoneNumberFormat.getInstance	(user.getPhoneLocale());
      FuzionConfig fuzionConfig = FuzionConfig.getInstance();
      MessageResources messages = getServlet().getResources();

...

}

Now, the 'getResources' method  in class ActionServlet class has been
depricated, the following note is provided in the java

getResources
public MessageResources getResources()Deprecated. Actions should call
Action.getResources(HttpServletRequest) instead of this method, in order to
retrieve the resources for the current module.


Now - my problem! The form bean is not a subclass to the Action class. How
is the best way to reach my message resources file?? Thanks in advance!

/Linnéa






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>