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 <ku...@yahoo.com> on 2003/10/29 17:00:46 UTC

how to use 2 resource files in one struts-config.xml?

Hi
I have 2 message resource files,
com.myapp.one.properties and com.myapp.two.properties
I haev some messages in one and some messages in two,
and want to display these in jsp and in action class
etc
how do i define them in my struts-config.xml and use
them with <bean:message...> tag.
This is what i am trying but is not working
<message-resources
key="org.apache.struts.action.MESSAGE"
parameter="com.myapp.one" />
<message-resources  key="message1"
parameter="com.myapp.two" />

and in my jsp i have
<bean:message key="errors.header"/> , where
errors.header is defines in one.properties
and 
<bean:message key="approval.001"/>
which is defines in two.properties file
i also tried
<bean:message key="message1.approval.001"/>
but does not work
Ashish

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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


Re: how to use 2 resource files in one struts-config.xml?

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi,
some how <bean:message key="approval.001"
bundle="message1"/>
does not work i still get the missing resource error,
how do i define the default bundle??
i am not using struts module
Ashish
--- Manish Singla <Ma...@Sun.COM> wrote:
> You may try following (from your example)
> <bean:message key="approval.001" bundle="message1"/>
> where bundle attribute maps to key attribute in
> <message-resources ...
> tag
> 
> You may have one default bundle.
> Thus for default bundle ...no need to give key in
> <message-resouces
> ...tag..
> for that bundle corresponding <bean:message > will
> be without bundle
> attributes follows
> <bean:message key="approval.001">
> 
> I assume you are not using struts modules...and is
> not trying to access
> message resources bundle of different bundle..
> 
> 
> Ashish Kulkarni wrote:
> 
> > Hi
> > I have 2 message resource files,
> > com.myapp.one.properties and
> com.myapp.two.properties
> > I haev some messages in one and some messages in
> two,
> > and want to display these in jsp and in action
> class
> > etc
> > how do i define them in my struts-config.xml and
> use
> > them with <bean:message...> tag.
> > This is what i am trying but is not working
> > <message-resources
> > key="org.apache.struts.action.MESSAGE"
> > parameter="com.myapp.one" />
> > <message-resources  key="message1"
> > parameter="com.myapp.two" />
> >
> > and in my jsp i have
> > <bean:message key="errors.header"/> , where
> > errors.header is defines in one.properties
> > and
> > <bean:message key="approval.001"/>
> > which is defines in two.properties file
> > i also tried
> > <bean:message key="message1.approval.001"/>
> > but does not work
> > Ashish
> >
> > __________________________________
> > Do you Yahoo!?
> > Exclusive Video Premiere - Britney Spears
> > http://launch.yahoo.com/promos/britneyspears/
> >
> >
>
---------------------------------------------------------------------
> > 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
> 


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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


Re: how to use 2 resource files in one struts-config.xml?

Posted by Manish Singla <Ma...@Sun.COM>.
You may try following (from your example)
<bean:message key="approval.001" bundle="message1"/>
where bundle attribute maps to key attribute in <message-resources ...
tag

You may have one default bundle.
Thus for default bundle ...no need to give key in <message-resouces
...tag..
for that bundle corresponding <bean:message > will be without bundle
attributes follows
<bean:message key="approval.001">

I assume you are not using struts modules...and is not trying to access
message resources bundle of different bundle..


Ashish Kulkarni wrote:

> Hi
> I have 2 message resource files,
> com.myapp.one.properties and com.myapp.two.properties
> I haev some messages in one and some messages in two,
> and want to display these in jsp and in action class
> etc
> how do i define them in my struts-config.xml and use
> them with <bean:message...> tag.
> This is what i am trying but is not working
> <message-resources
> key="org.apache.struts.action.MESSAGE"
> parameter="com.myapp.one" />
> <message-resources  key="message1"
> parameter="com.myapp.two" />
>
> and in my jsp i have
> <bean:message key="errors.header"/> , where
> errors.header is defines in one.properties
> and
> <bean:message key="approval.001"/>
> which is defines in two.properties file
> i also tried
> <bean:message key="message1.approval.001"/>
> but does not work
> Ashish
>
> __________________________________
> Do you Yahoo!?
> Exclusive Video Premiere - Britney Spears
> http://launch.yahoo.com/promos/britneyspears/
>
> ---------------------------------------------------------------------
> 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