Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!