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 18:31:26 UTC

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

Hi
Thanx for all the replies
I was able to solve the problem by defining 
<message-resources key="approvals"
parameter="com.myapp.one" />
<message-resources
key="org.apache.struts.action.MESSAGE"
parameter="com.myapp.two" />
instead of 

<message-resources
key="org.apache.struts.action.MESSAGE"
parameter="com.myapp.two" />
<message-resources key="approvals"
parameter="com.myapp.one" />

just by defining the two with key approvals before
one, solved the problem
my message tag in jsp still is same
<bean:message key="approval.002"  bundle="approvals"/>

for messages from two.property file

So it was just the sequence in which to define it in
struts-config.xml file
Ashish

--- Ben Anderson <st...@hotmail.com>
wrote:
> in your struts-config.xml:
>     <!-- this is now your default resource bundle
> -->
>     <message-resources parameter="com.myapp.one"/>
>     <message-resources parameter="com.myapp.two"
> key="MESSAGE_TWO"/>
> in your jsps:
>     <bean:message key="errors.header"/>
>     <bean:message key="approval.001"
> bundle="MESSAGE_TWO"/>
> 
> 
> 
> >From: Ashish Kulkarni <ku...@yahoo.com>
> >Reply-To: "Struts Users Mailing List"
> <st...@jakarta.apache.org>
> >To: Struts Users Mailing List
> <st...@jakarta.apache.org>
> >Subject: Re: how to use 2 resource files in one
> struts-config.xml?
> >Date: Wed, 29 Oct 2003 08:56:53 -0800 (PST)
> >
> >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
> >
> 
>
_________________________________________________________________
> Fretting that your Hotmail account may expire
> because you forgot to sign in 
> enough? Get Hotmail Extra Storage today!   
> http://join.msn.com/?PAGE=features/es
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


=====
A$HI$H

__________________________________
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: Reset button not always working

Posted by st...@daydream.stanford.edu.
The reset should change all values on your jsp page to those matching the 
html page, which would be populated by your ActionForm.

In other words, if you haven't changed any of the values on your web page, 
then the reset would appear to do nothing. Is that the behavior you're 
expecting, or are you expecting it to do something else?

It basically just resolves to the following html in the simplest case:
---
<input type="reset" name="reset" value="Reset">
---

At least that's my understanding.

Regards,
Oscar


On Wed, 29 Oct 2003, ZYD wrote:

> Dear all,
> 
> I have a Reset button on a Jsp page:
> 
> <html:reset>
>          <bean:message key="button.reset"/>
> </html:reset>
> 
> It works at first load. But when I forward to this page from other
> pages, this Reset button does nothing, it does not reset anything.
> 
> Does this problem sound familiar to you guys? 
> 
> cheers
> 
> bruce
> 


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


Reset button not always working

Posted by ZYD <el...@hotmail.com>.
Dear all,

I have a Reset button on a Jsp page:

<html:reset>
         <bean:message key="button.reset"/>
</html:reset>

It works at first load. But when I forward to this page from other pages, this Reset button does nothing, it does not reset anything.

Does this problem sound familiar to you guys? 

cheers

bruce

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

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi
i have no clue why it was not working before,
but now it is working and i ma happy :-)

Ashish
--- Manish Singla <Ma...@Sun.COM> wrote:
> hmmmmmmmmmm...........
> 
> You may not have to define message-resources with
> key="org.apache.struts.action.MESSAGE".
> 
> Default bundle (with no key attribute in
> message-resources) is stored by 
> struts using key="org.apache.struts.action.MESSAGE".
> 
> I am not sure how come switching location of
> message-resources solve 
> your problem ?? !!!
> 
> 
> 
> 
> 
> Ashish Kulkarni wrote:
> > Hi
> > Thanx for all the replies
> > I was able to solve the problem by defining 
> > <message-resources key="approvals"
> > parameter="com.myapp.one" />
> > <message-resources
> > key="org.apache.struts.action.MESSAGE"
> > parameter="com.myapp.two" />
> > instead of 
> > 
> > <message-resources
> > key="org.apache.struts.action.MESSAGE"
> > parameter="com.myapp.two" />
> > <message-resources key="approvals"
> > parameter="com.myapp.one" />
> > 
> > just by defining the two with key approvals before
> > one, solved the problem
> > my message tag in jsp still is same
> > <bean:message key="approval.002" 
> bundle="approvals"/>
> > 
> > for messages from two.property file
> > 
> > So it was just the sequence in which to define it
> in
> > struts-config.xml file
> > Ashish
> > 
> > --- Ben Anderson <st...@hotmail.com>
> > wrote:
> > 
> >>in your struts-config.xml:
> >>    <!-- this is now your default resource bundle
> >>-->
> >>    <message-resources parameter="com.myapp.one"/>
> >>    <message-resources parameter="com.myapp.two"
> >>key="MESSAGE_TWO"/>
> >>in your jsps:
> >>    <bean:message key="errors.header"/>
> >>    <bean:message key="approval.001"
> >>bundle="MESSAGE_TWO"/>
> >>
> >>
> >>
> >>>From: Ashish Kulkarni
> <ku...@yahoo.com>
> >>>Reply-To: "Struts Users Mailing List"
> >>
> >><st...@jakarta.apache.org>
> >>
> >>>To: Struts Users Mailing List
> >>
> >><st...@jakarta.apache.org>
> >>
> >>>Subject: Re: how to use 2 resource files in one
> >>
> >>struts-config.xml?
> >>
> >>>Date: Wed, 29 Oct 2003 08:56:53 -0800 (PST)
> >>>
> >>>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
> >>
> >>
> >
>
_________________________________________________________________
> > 
> >>Fretting that your Hotmail account may expire
> >>because you forgot to sign in 
> >>enough? Get Hotmail Extra Storage today!   
> >>http://join.msn.com/?PAGE=features/es
> >>
> >>
> >>
> > 
> >
>
---------------------------------------------------------------------
> > 
> >>To unsubscribe, e-mail:
> >>struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail:
> >>struts-user-help@jakarta.apache.org
> >>
> > 
> > 
> > 
> > =====
> > A$HI$H
> > 
> > __________________________________
> > 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
> > 
> 
> 
> -- 
> Thanks
> Manish Singla
> x73166
> 
> 
>
---------------------------------------------------------------------
> 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? solved it thanx

Posted by Manish Singla <Ma...@Sun.COM>.
hmmmmmmmmmm...........

You may not have to define message-resources with
key="org.apache.struts.action.MESSAGE".

Default bundle (with no key attribute in message-resources) is stored by 
struts using key="org.apache.struts.action.MESSAGE".

I am not sure how come switching location of message-resources solve 
your problem ?? !!!





Ashish Kulkarni wrote:
> Hi
> Thanx for all the replies
> I was able to solve the problem by defining 
> <message-resources key="approvals"
> parameter="com.myapp.one" />
> <message-resources
> key="org.apache.struts.action.MESSAGE"
> parameter="com.myapp.two" />
> instead of 
> 
> <message-resources
> key="org.apache.struts.action.MESSAGE"
> parameter="com.myapp.two" />
> <message-resources key="approvals"
> parameter="com.myapp.one" />
> 
> just by defining the two with key approvals before
> one, solved the problem
> my message tag in jsp still is same
> <bean:message key="approval.002"  bundle="approvals"/>
> 
> for messages from two.property file
> 
> So it was just the sequence in which to define it in
> struts-config.xml file
> Ashish
> 
> --- Ben Anderson <st...@hotmail.com>
> wrote:
> 
>>in your struts-config.xml:
>>    <!-- this is now your default resource bundle
>>-->
>>    <message-resources parameter="com.myapp.one"/>
>>    <message-resources parameter="com.myapp.two"
>>key="MESSAGE_TWO"/>
>>in your jsps:
>>    <bean:message key="errors.header"/>
>>    <bean:message key="approval.001"
>>bundle="MESSAGE_TWO"/>
>>
>>
>>
>>>From: Ashish Kulkarni <ku...@yahoo.com>
>>>Reply-To: "Struts Users Mailing List"
>>
>><st...@jakarta.apache.org>
>>
>>>To: Struts Users Mailing List
>>
>><st...@jakarta.apache.org>
>>
>>>Subject: Re: how to use 2 resource files in one
>>
>>struts-config.xml?
>>
>>>Date: Wed, 29 Oct 2003 08:56:53 -0800 (PST)
>>>
>>>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
>>
>>
> _________________________________________________________________
> 
>>Fretting that your Hotmail account may expire
>>because you forgot to sign in 
>>enough? Get Hotmail Extra Storage today!   
>>http://join.msn.com/?PAGE=features/es
>>
>>
>>
> 
> ---------------------------------------------------------------------
> 
>>To unsubscribe, e-mail:
>>struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>struts-user-help@jakarta.apache.org
>>
> 
> 
> 
> =====
> A$HI$H
> 
> __________________________________
> 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
> 


-- 
Thanks
Manish Singla
x73166


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