Hello Muki, I am right now struggling with it. If I do as the other guy proposed, I get a NullPointer... He told : (MessageResources) this.getServlet().getServletContext().getAttribute(Action.MESSAGE_KEY);
Will tell you whether I find the solution first ;-) I have few hours left to find it, anyway... ----- Original Message ----- From: Soomar, Muki (R.) <[EMAIL PROTECTED]> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 5:30 PM Subject: RE: ActionServlet.getResources() Method alternative ?? > > I am trying to check if I have access to the Message Resources in my ActionForm subclass before I > use the error messages that are available in the Message resource bundle. > > So earlier I was using: > MessageResources errorMessages = servlet.getResources(); > to get the resource object. > > Then I check if this object is not null and also try to retrieve a message for a key.. e.g > servlet.log ( errorMessages.getMessage("form.name.required"); > > This will log into my log file and confirm that, yes indeed I have access to all my message resources. > > However, now the above method on the ActionServlet is deprecated. The ActionSevlet object was > availble to me inside the ActionForm object. > > My dilemma is what other methods are available to me now to retrieve the MessageResources object > > << Barbara wrote: > MessageResources getResources() > Deprecated. Actions should call > Action.getResources(HttpServletRequest) instead of this method, in order to > retrieve the resources for the current sub-application > >> > > The above is only applicable from my Action subclass not my ActionForm subclass. > I was just trying to ensure that I would have access to my MessageResources before > I use it in my ActionForm subclass... > > Any more suggestions how I could do this.. ??? > > Thanks. > > Muki Soomar ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>