You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Kulkarni <as...@gmail.com> on 2007/08/31 16:47:43 UTC

reading properties file in action class

Hi
I have abc.properties and abc_fr.properties file,
if i have to print values from properties file in jsp i use tag
<bean:message key="PL1143.datecompare"/> and it will print value depending
on locale,
But what i want to get those values in action class, is there an direct
method to do so,
Like some thing getText("PL1143.datecompare")
i can read load properties file using servletContext, but i want to avoid
that.
is there any method in struts action for helping in doing so

Re: reading properties file in action class

Posted by Ashish Kulkarni <as...@gmail.com>.
Hi
Thanks, it works

On 8/31/07, nuwan chandrasoma <my...@gmail.com> wrote:
>
> Hi,
>
> use getResources() method in the action
>
> Thanks,
>
> Nuwan
>
> On 8/31/07, Ashish Kulkarni <as...@gmail.com> wrote:
> >
> > Hi
> > I have abc.properties and abc_fr.properties file,
> > if i have to print values from properties file in jsp i use tag
> > <bean:message key="PL1143.datecompare"/> and it will print value
> depending
> > on locale,
> > But what i want to get those values in action class, is there an direct
> > method to do so,
> > Like some thing getText("PL1143.datecompare")
> > i can read load properties file using servletContext, but i want to
> avoid
> > that.
> > is there any method in struts action for helping in doing so
> >
>

Re: reading properties file in action class

Posted by nuwan chandrasoma <my...@gmail.com>.
Hi,

use getResources() method in the action

Thanks,

Nuwan

On 8/31/07, Ashish Kulkarni <as...@gmail.com> wrote:
>
> Hi
> I have abc.properties and abc_fr.properties file,
> if i have to print values from properties file in jsp i use tag
> <bean:message key="PL1143.datecompare"/> and it will print value depending
> on locale,
> But what i want to get those values in action class, is there an direct
> method to do so,
> Like some thing getText("PL1143.datecompare")
> i can read load properties file using servletContext, but i want to avoid
> that.
> is there any method in struts action for helping in doing so
>