You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anil Kumar T <an...@infics.com> on 2006/07/19 16:10:44 UTC

Accessing messages. from action, dao classes.

Hi guys,



I would like ot know how to acess the resource properties from an action
class or subsequent DAO classes. Any help, links etc would be great.



Thanks & regards,

Anil.



Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and / or its Customers and is intended for use only by the individual or the entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at info.in@infics.com and delete this email from your records.

Re: Accessing messages. from action, dao classes.

Posted by Adam Gordon <ad...@readytalk.com>.
Anil-

In your action, you already have access to the resource properties 
file.  In any member method, as long as you have an instance of the 
request object, you can say:

// get the resources for this action servlet
MessageResources resources = this.getResources(request);

to retrieve the MR for whatever module your action is a part of.  Then, 
you can call 
resources.getMessage("the.name.of.the.key.in.the.properties.file") to 
retrieve your i18n property.

Cheers,

-Adam

Anil Kumar T wrote:
> Hi guys,
>
>
>
>
> I would like ot know how to acess the resource properties from an action
> class or subsequent DAO classes. Any help, links etc would be great.
>
>
>
>
> Thanks & regards,
>
> Anil.
>
>
>
> Information transmitted by this e-mail is proprietary to Infinite
> Computer Solutions and / or its Customers and is intended for use only
> by the individual or the entity to which it is addressed, and may
> contain information that is privileged, confidential or exempt from
> disclosure under applicable law. If you are not the intended recipient
> or it appears that this mail has been forwarded to you without proper
> authority, you are notified that any use or dissemination of this
> information in any manner is strictly prohibited. In such cases, please
> notify us immediately at info.in@infics.com and delete this email from
> your records.
>
>   

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