• Post Reply Bookmark Topic Watch Topic
  • New Topic

struts2 tiles problem  RSS feed

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have this wierd issue with tiles. Please let me know what could be wrong.

I want to insert a tile (a jsp page) into another tile (a jsp page) and so am using <tiles:insertDefinition name="status.index"/>

This is my config (simplified):



So now everything works fine and I can see the static contents of the status.jsp file which just contains text like ('this is a test').

But if I try to insert the line <tiles:insertDefinition name="status.index"/> in searchEmployee.jsp instead of the layout.jsp, things fail and I get nullpointerexceptions and all.

I'm now wondering can we use <tiles:insertDefinition name="status.index"/> in a jsp that is used for <tiles:insertAttribute name="body" />??

Basically then whats the equivalent of <tiles:insert> in tiles 1.x to be used in struts 2 tiles.

Tks
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help please?
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help please?
 
Ranch Hand
Posts: 2074
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For nesting tiles, try this.
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jesus,

Tks for the reply. The example link you gave above is for Struts 1.x and I've always done it myself (used solution 1) and it worked like a charm. However its not working when I apply the same approach for Struts 2.x using tiles:insertDefinition.
Thats where I'm stuck.
Tks!
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I've narrowed the problem down.
And its coming out that tiles insertDefinition and struts tag don't work together.

Eg.

searchEmployee.jsp - This works


searchEmployee.jsp - This also works



searchEmployee.jsp - This does NOT work



Any suggestions?
Tks
[ August 08, 2008: Message edited by: Raj Bhandari ]
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still stuck on this.. can anyone help?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an alternative for
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

and not to refer struts.apache.org ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!