Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Two tiles definition files in one configuration file

 
poornima balagopal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have two configuration file. I have plugged these two in the struts-config.xml as
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs-crms.xml"/>
<set-property property="definitions-config" value="/WEB-INF/tiles-defs-embargo.xml"/>
<set-property property="moduleAware" value="true"/>
<set-property property="definitions-parser-validate" value="false"/>
</plug-in>
When i give like this only the second file is reading. When i gave two files as two plug in then also only the first one is reading.
so how can i solve this
Please help me
 
Pramoda Bhat
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this in your struts-config.xml
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml,
/WEB-INF/tiles-tests-defs.xml" />
<set-property property="definitions-parser-validate" value="true" />
<set-property property="moduleAware" value="true" />
</plug-in>
 
James Holmes
Author
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Poorima,
To use multiple files with the TIles plugin you have specify a comma-delimited list for the "definitions-config" parameter, as shown next.
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs-crms.xml,
/WEB-INF/tiles-defs-embargo.xml"/>
<set-property property="moduleAware" value="true"/>
<set-property property="definitions-parser-validate" value="false"/>
</plug-in>
Hope that helps,
-James
http://www.jamesholmes.com/struts/
 
poornima balagopal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thank you to both of you. Its working fine.
I have one more doubt. If i have one default configuration file and two other module specified file(examples configuration 1 and 2 files). And correpsonding to these three i have three tiles-def.xml file , tiles-defs.xml, tiles-defs1.xml and tiles-defs2.xml . I want to know can i specify the default tiles-defs.xml file in my default configuration file and other two in the correponding module's configuration files.
Because when i tried this way it was not working. I had to give the name of those two tiles files in the default configuration file as you told and again i had to give the plug in in the corresponding module specified configuration file
thank you once again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic