struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Kuzmin" <kuz...@soft-ukraine.com>
Subject Re: Getting Messages in an Action?
Date Tue, 16 Sep 2003 16:12:38 GMT
org.apache.struts.action.ExceptionHandler:
<snip>
public ActionForward execute(Exception ex,
                                 ExceptionConfig ae,
                                 ActionMapping mapping,
                                 ActionForm formInstance,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
</snip>

MessageResources resources = (MessageResources)
request.getAttribute(Globals.MESSAGES_KEY);

--
Andrew Kuzmin
http://www.java201.com


----- Original Message -----
From: "Adolfo Miguelez" <pelly69@hotmail.com>
To: <struts-user@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 6:47 PM
Subject: Re: Getting Messages in an Action?


> and what about from an ExceptionHandler?
>
>
> >From: "Andrew Kuzmin" <kuzmin@soft-ukraine.com>
> >Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>,
> >"Carl-Eric Menzel" <cm-strutsuserlist@bitforce.com>
> >Subject: Re: Getting Messages in an Action?
> >Date: Tue, 16 Sep 2003 18:29:39 +0300
> >
> >MessageResources resources = getResources(request);
> >java.util.Locale locale = getLocale(request);
> >String yourString = resources.getMessage(locale, "yourString");
> >
> >--
> >Andrew Kuzmin
> >http://www.java201.com
> >
> >
> >----- Original Message -----
> >From: "Carl-Eric Menzel" <cm-strutsuserlist@bitforce.com>
> >To: <struts-user@jakarta.apache.org>
> >Sent: Tuesday, September 16, 2003 6:21 PM
> >Subject: Getting Messages in an Action?
> >
> >
> > >
> > > Hello,
> > >
> > > is it possible to retrieve a message from the application resources
> > > (like <bean:message key="..."/>) inside an Action? How can I get to
> > > the current localized messages?
> > >
> > > Thanks
> > > Carl-Eric
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message