Struts has a class called RequestUtils and you can call
RequestUtils.message(pageContext, bundle, locale, key);
But maybe you should be creating your array in the Action
and passing storing it in the Form for the JSP to grab.
Then you can get messages in an action like this:
// default bundle
MessageResources mr1 = getResources(request);
String s1 = mr1.getMessage("welcome.message");
// some other bundle
MessageResources mr2 = getResources(request, "alt_bundle");
String s2 = mr2.getMessage("welcome.message");
- Dan
> -----Original Message-----
> From: AMIR-TAHMASSEB Marc [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 05, 2003 6:16 AM
> To: Struts Users Mailing List
> Subject: RE: using ApplicationResources in jsp...
>
>
> because i have to put it on an array of String and then i use
> this array in the code by a generic code.
>
> > -----Message d'origine-----
> > De : Jimmy Emmanual [mailto:[EMAIL PROTECTED]
> > Envoy� : vendredi 5 d�cembre 2003 15:10
> > � : 'Struts Users Mailing List'
> > Objet : RE: using ApplicationResources in jsp...
> >
> >
> > why do you need to? why not just:
> >
> > <html:html>
> > <body>
> > <bean:message key="title.from.ressources"/>
> > </body>
> > </html:html>
> >
> >
> > -----Original Message-----
> > From: AMIR-TAHMASSEB Marc
> [mailto:[EMAIL PROTECTED]
> > Sent: Friday, December 05, 2003 9:07 AM
> > To: Struts Users Mailing List
> > Subject: RE: using ApplicationResources in jsp...
> >
> >
> > because i need to get the value of my property inside a <% ... %>
> >
> > > -----Message d'origine-----
> > > De : Hunziker Dennis [mailto:[EMAIL PROTECTED]
> > > Envoy� : vendredi 5 d�cembre 2003 15:03
> > > � : 'Struts Users Mailing List'
> > > Objet : RE: using ApplicationResources in jsp...
> > >
> > >
> > > why not try the following:
> > > <bean:message key="title.from.ressources"/>
> > >
> > > -----Original Message-----
> > > From: AMIR-TAHMASSEB Marc
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Freitag, 5. Dezember 2003 15:01
> > > To: [EMAIL PROTECTED]
> > > Subject: using ApplicationResources in jsp...
> > >
> > >
> > > Hi,
> > > i wonder to know if it's possible to use a property in
> > > ApplciationResources
> > > in the jsp code.
> > >
> > > I want to do something like this :
> > >
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > > <%@ page language="java" %>
> > > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > > <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
> > > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> > > <%
> > > String title = title.from.ressources; // i don't know how
> > > to access it !
> > > %>
> > > <html:html>
> > > <body>
> > > <%=title%>
> > > </body>
> > > </html:html>
> > >
> > >
> > >
> > > --
> > > Marc AMIR-TAHMASSEB
> > > [EMAIL PROTECTED]
> > > <mailto:[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]
> >
> >
>
> ---------------------------------------------------------------------
> 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]