Hi,

When I define the message resources as:

  <message-resources parameter="PortalMessages"  null="false"/>
  <message-resources parameter="PortalResources" null="false"
key="PortalResources"/>

I can access them from jsp as:

    <bean:message key="portal.cnw"/>
    <bean:message bundle="PortalResources" key="shortTitle"/>

But, when I execute this from an ActionForm:

   MessageResources mrs = (MessageResources) request.getAttribute
("PortalResources");
   System.err.println ("PortalResources: " + mrs);

I get:

    PortalResources: null

Thanks, Will




----- Original Message ----- 
From: "Matthias Wessendorf" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>;
"'e-denton Java Programmer'" <[EMAIL PROTECTED]>
Sent: Wednesday, January 07, 2004 8:49 AM
Subject: RE: Resources from ActionForm


> hi,
>
> in an actionForm.validate():
>
> MessageResources res =
> (MessageResources) request.getAttribute(GLOBALS.MESSAGES_KEY); //thats
> default-key
>
> String foo = res.getMessage("my_Key_In_bundle");
> //get an message
>
> greetings
>
>
> -----Original Message-----
> From: e-denton Java Programmer [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 07, 2004 3:42 PM
> To: Struts Users Mailing List
> Subject: Resources from ActionForm
>
>
> Hi,
>
> I want to access a resource bundle (key=PORTAL_RESOURCES) from an
> ActionForm to pull out display names for error messages (ActionError). I
> can't see how to access the resource bundle and pull out the strings I
> want.
>
> Thanks for your help.
>
> Will
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to