• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts2 tiles problem

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any help please?
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any help please?
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For nesting tiles, try this.
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
still stuck on this.. can anyone help?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
reply
    Bookmark Topic Watch Topic
  • New Topic