You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alexander Muss <sa...@gmx.net> on 2011/01/27 07:40:09 UTC

Struts 2 replacement for Struts 1 message bundles

Hi,

Currently we are using Struts 1 but next version of our application have  
to be
implemented with one other framework. Thats why we want to use Struts 2  
instead.

But the problem is, there seem to be no way to implement same feature as  
resource-,
message- bundles in Struts 1.

My question is:
	Is there any replacement for Struts 1 bundles ore any other way to  
implement this?


Kind Regards,

Alexander

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


Re: Struts 2 replacement for Struts 1 message bundles (resources)

Posted by Dave Newton <da...@gmail.com>.
<s:i18n name="some.package.bundle" >
     <s:text name="some.key" /></s:i18n>



On Thu, Jan 27, 2011 at 1:11 PM, Alexander Muss
<sa...@googlemail.com>wrote:

> Hi,
>
> I don't think this is what we need.
>
> at the time we have this lines in struts-config.xml
>
>        <message-resources parameter="Messages" null="false"/>
>        <message-resources key="1Bundle" parameter="1Messages"
> null="false"/>
>        <message-resources key="3Bundle" parameter="3Messages"
> null="false"/>
>        <message-resources key="4Bundle" parameter="4Messages"
> null="false"/>
>        <message-resources key="5Bundle" parameter="5Messages"
> null="false"/>
>
> and in jsp we access this message-resources in following way.
> <%
>        // this string is usually read from business logic layer
>        String bundleName = "900Bundle";
> %>
>
> <bean:message bundle="<%=bundleName%>" key="common.incentive"/>
>
> This is needed because a single application is used for multiple stores,
> so it should be possible to have own bundles for each store.
>
> Is there any possibility to have same behavior in Struts 2?
>
> Kind regards,
>
> Alexander
>
>
>
> On Thu, 27 Jan 2011 13:22:05 +0100, Dave Newton <da...@gmail.com>
> wrote:
>
>  http://struts.apache.org/2.x/docs/localization.html
>>
>> On Thu, Jan 27, 2011 at 1:40 AM, Alexander Muss <sa...@gmx.net>
>> wrote:
>>
>>  Hi,
>>>
>>> Currently we are using Struts 1 but next version of our application have
>>> to
>>> be
>>> implemented with one other framework. Thats why we want to use Struts 2
>>> instead.
>>>
>>> But the problem is, there seem to be no way to implement same feature as
>>> resource-,
>>> message- bundles in Struts 1.
>>>
>>> My question is:
>>>       Is there any replacement for Struts 1 bundles ore any other way to
>>> implement this?
>>>
>>>
>>> Kind Regards,
>>>
>>> Alexander
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>
> --
> Erstellt mit Operas revolutionärem E-Mail-Modul:
> http://www.opera.com/mail/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts 2 replacement for Struts 1 message bundles (resources)

Posted by Alexander Muss <sa...@googlemail.com>.
Hi,

I don't think this is what we need.

at the time we have this lines in struts-config.xml

	<message-resources parameter="Messages" null="false"/>
	<message-resources key="1Bundle" parameter="1Messages" null="false"/>
	<message-resources key="3Bundle" parameter="3Messages" null="false"/>
	<message-resources key="4Bundle" parameter="4Messages" null="false"/>
	<message-resources key="5Bundle" parameter="5Messages" null="false"/>

and in jsp we access this message-resources in following way.
<%
	// this string is usually read from business logic layer
	String bundleName = "900Bundle";
%>

<bean:message bundle="<%=bundleName%>" key="common.incentive"/>

This is needed because a single application is used for multiple stores,
so it should be possible to have own bundles for each store.

Is there any possibility to have same behavior in Struts 2?

Kind regards,

Alexander



On Thu, 27 Jan 2011 13:22:05 +0100, Dave Newton <da...@gmail.com>  
wrote:

> http://struts.apache.org/2.x/docs/localization.html
>
> On Thu, Jan 27, 2011 at 1:40 AM, Alexander Muss <sa...@gmx.net>  
> wrote:
>
>> Hi,
>>
>> Currently we are using Struts 1 but next version of our application  
>> have to
>> be
>> implemented with one other framework. Thats why we want to use Struts 2
>> instead.
>>
>> But the problem is, there seem to be no way to implement same feature as
>> resource-,
>> message- bundles in Struts 1.
>>
>> My question is:
>>        Is there any replacement for Struts 1 bundles ore any other way  
>> to
>> implement this?
>>
>>
>> Kind Regards,
>>
>> Alexander
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>


-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

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


Re: Struts 2 replacement for Struts 1 message bundles

Posted by Dave Newton <da...@gmail.com>.
http://struts.apache.org/2.x/docs/localization.html

On Thu, Jan 27, 2011 at 1:40 AM, Alexander Muss <sa...@gmx.net> wrote:

> Hi,
>
> Currently we are using Struts 1 but next version of our application have to
> be
> implemented with one other framework. Thats why we want to use Struts 2
> instead.
>
> But the problem is, there seem to be no way to implement same feature as
> resource-,
> message- bundles in Struts 1.
>
> My question is:
>        Is there any replacement for Struts 1 bundles ore any other way to
> implement this?
>
>
> Kind Regards,
>
> Alexander
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>