• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

tile question

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I add action to a common element (header.jsp) for tile layout?

thanks
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hong Yi,

If I understand your question, you want to use header.jsp in several tiles?.?.

That being the case, you can extend a tile from a parent. Example:

Suppose you have an action mapping in your struts-config.xml to display your home page, which you want to incorporate header.jsp


In your tiles-defs.xml, do the following:



In this case, tile:showhome inherits tile:layout which contains header.jsp.

Now, in layout.jsp, do something like this:



Now, you can reuse layout by extending it in other tiles and changing the page.body name attribute to whatever jsp applies for the other pages.

I hope that answers your question...
Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
He's giving us the slip! Quick! Grab this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!