my dog learned polymorphism*
The moose likes Struts and the fly likes Tiles problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles problem" Watch "Tiles problem" New topic
Author

Tiles problem

Raj Bhandari
Ranch Hand

Joined: Oct 19, 2005
Posts: 97
Hi,

Can someone please help me figure out this problem while trying to use tiles:

I have a page index.jsp as follows:



In my tiles-defs.xml:


In mainLayout.jsp:


Now the issue is that in my struts-config.xml, I following which works fine..


but when I change the forward (within global-forward) to use tiles like search.page below:


the url doesn't get changed to search.jsp as should be according to the tiles-defs.xml and hence, I can't get to search.jsp.

Does, someone has an idea why this forward path isn't mapping properly.

The tiles work fine if its in my <action-mapping> just not forward. Any ideas please ?
Tks
[ April 11, 2006: Message edited by: Raj Bhandari ]
Kumar Hanu
Greenhorn

Joined: Sep 18, 2004
Posts: 5
To use tiles-defs.xml u should have the tiles plugin defined in your struts-config.xml. Something link the following

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="false" />
</plug-in>

Hope this solves your ploblem.
Raj Bhandari
Ranch Hand

Joined: Oct 19, 2005
Posts: 97
Thanks Kumar for the reply but I'm already doing that and tiles works for me when using in action mapping, just not on global-forwards. This is my first time using tiles.. so I'm not sure what else should I look for. Tks
Liju Cherian
Ranch Hand

Joined: Mar 17, 2006
Posts: 44
Change your base layout page from
to

With the help of the above mentioned code, you'll be able to identify if there is any error, present in the pages rendered using this layout.
Hope this helps.

Liju


"What's in a name? That which we call a rose by any other name would smell just as sweet."<br />(William Shakespeare, Romeo and Juliet, Act II, Scene II)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tiles problem