You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sergio del Amo Caballero <se...@sbox.tugraz.at> on 2007/05/09 17:56:06 UTC

Can tiles access Application.properties?

hello,

I am using tiles together with struts to build a web application. This
web application will have different themes. Basically i would like to
know if it is possible to declare a variable inside tiles definition
file or access a Application.properties definition from the
tiles-def.xml file.

As it is shown in the example below, i have to write directly in almost
every line what theme i am using e.g. themeA. Instead i would like to be
able to reference a variable such as themeName, where i define the theme
that i want to use.

 <!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration//EN"
       "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">

<tiles-definitions>

  <definition name=".login" path="/themes/themeA/jsp/login.jsp"/>

  <definition name=".baseDef" path="/themes/themeA/jsp/template.jsp">
        <put name="title"    value="Base Template Page" />
        <put name="header"   value="/themes/themeA/velocity/header.vm" />
        <put name="content"  value="/themes/themeA/jsp/baseContent.jsp" />
        <put name="footer"   value="/themes/themeA/jsp/footer.jsp"/>
  </definition>

  <definition name=".homePage" extends=".baseDef">
      <put name="title" value="Home" />
      <put name="content"
value="/themes/themeA/velocity/homePageContent.vm" />
  </definition>

<tiles-definitions>


thanks for you future feedback,
Sergio del Amo

PS. I posted this question in the tiles mailing list but they told me to
ask better here since i am using tiles together with struts.



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


Re: Can tiles access Application.properties?

Posted by Antonio Petrelli <an...@gmail.com>.
2007/5/9, Sergio del Amo Caballero <se...@sbox.tugraz.at>:
> PS. I posted this question in the tiles mailing list but they told me to
> ask better here since i am using tiles together with struts.

Probably you did not see my answer. Since I feel a nice boy today :-P
I will copy/paste here:

<snip>
This is not possible with the basic implementation of Tiles. But I
think that you can create a different DefinitionsFactory (or
FactorySet in Struts-Tiles) that takes a theme somewhere (for example,
from the session) and applies it to the attributes.
</snip>

Antonio

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