You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthias Stoll <ma...@hpigmbh.com> on 2006/12/18 08:31:08 UTC

Register plugin in "Tiles plugin configuration"

Thx Antonio

extending and overriding nop, but how to register in "Tiles plugin 
configuration". Do you mean chain-config.xml? How to do that?

TXH

Matthias Stoll ha scritto:
> Hi there.
>
> I have a Tiles / Struts application. When using i18n in Struts (property 

> files) everything works fine, even if the user has selected a language 
in 
> his browser (e.g. en as preferred language, struts loads the property_en 

> file). Tiles is not doing so. It loads the default definition file 
> (without _en or _de) at initialization. Struts controller Locale is set 
to 
> true. Tiles only changes locale when manually setting 
> request.getSession().setAttribute (Globals.LOCALE_KEY, Locale.ENGLISH). 
> Does anyone have an idea, what the problem is?
> 

Uh you're right! I18NFactorySet takes the locale only from the session! 
Anyway you can:
* use Tiles 2 (that is currently in the sandbox 
http://struts.apache.org/struts-sandbox/tiles/index.html ) that does not 
suffer from this problem
* or create your own FactorySet, extending I18NFactorySet and overriding 
the getDefinitionsFactoryKey, taking the locale from the request. 
Obviously you have to register it in the Tiles plugin configuration.

HTH
Antonio

Re: Register plugin in "Tiles plugin configuration"

Posted by Matthias Stoll <ma...@hpigmbh.com>.
You are my master :-)

It works. Great. THX


Mit freundlichen Grüßen / With best regards

Matthias Stoll
IT & Processing
HPI - procurement unlimited
______________________________________
HPI GmbH
Am Limespark 2
D-65843 Sulzbach (Taunus)

Office: +49(69)305-83249
Fax:    +49(69)305-80409
Mobile: +49(163)3282027
eMail:  matthias.stoll@hpigmbh.com
______________________________________



Antonio Petrelli <ap...@apache.org> 
18.12.2006 08:47
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
Struts Users Mailing List <us...@struts.apache.org>
cc

Subject
Re: Register plugin in "Tiles plugin configuration"






Matthias Stoll ha scritto:
> Thx Antonio
>
> extending and overriding nop, but how to register in "Tiles plugin 
> configuration". Do you mean chain-config.xml? How to do that?
> 

You have to modify the plugin configuration, in struts-config.xml.

<plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property
        property="definitions-config"
           value="/WEB-INF/tiles-defs.xml"/>
    <set-property
        property="definitions-factory-class"
           value="name.of.YourClass"/>
</plug-in>

Ahhh lazyness :-P

HTH
Antonio


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



Re: Register plugin in "Tiles plugin configuration"

Posted by Antonio Petrelli <ap...@apache.org>.
Matthias Stoll ha scritto:
> Thx Antonio
>
> extending and overriding nop, but how to register in "Tiles plugin 
> configuration". Do you mean chain-config.xml? How to do that?
>   

You have to modify the plugin configuration, in struts-config.xml.

<plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property
        property="definitions-config"
           value="/WEB-INF/tiles-defs.xml"/>
    <set-property
        property="definitions-factory-class"
           value="name.of.YourClass"/>
</plug-in>

Ahhh lazyness :-P

HTH
Antonio


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