Globals are in the struts.jar org.apache.struts.Globals
Have a nice day Michael ----- Original Message ----- From: "Honza Spurný" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, November 25, 2003 11:07 AM Subject: Re: MessageResources in ActionForm > Manish Singla wrote: > > Hi > > > > Use following > > > > MessageResources mr = ((MessageResources) > > request.getAttribute(Globals.MESSAGES_KEY)); > ^^^^^^^^ > > what is Globals ??? I've tried it, but my java compiler does not knows it... > > > > > Instaed of > > > >> MessageResources mr = request.getMessageResources(); > > > > HTH > > Manish Singla > > > > > > > > Honza Spurný wrote: > >> Hi there, > >> > >> I'm able to read values from MessageResources in JSP files. But in > >> special case I need to read such values in java-classes. > >> Unfortunatelly I need it in ActionForm in validate() method... > >> > >> To understand me I'm attaching my vision of how it could be very > >> easy (it doesn't work): > >> > >> public ActionErrors validate(ActionMapping mapping, > >> HttpServletRequest request){ > >> MessageResources mr = request.getMessageResources(); > >> ActionErrors errors = new ActionErrors(); > >> > >> if (anyReasonToFailValidation){ > >> errors.add("Error found", new ActionError("key.to.this.error", > >> mr.getMessage("key.to.errorMessageParameter"))); > >> > >> return errors; > >> } > >> > >> I think it's clear why I need to have an object of Messageresources > >> in ValidatorForm. > >> > >> Please, could anybody help me? > >> > >> Thanks a lot. > >> Sporak > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]