• 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

Defining onLoad() function for a struts tiles page

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using a Struts tiles inheritance to design my web pages.

There is a layout "Layout.jsp" page which defines <head> and <body> content for all the web pages.

I am having definitions in my tiles-def.xml for two JSP pages AppPage1 and AppPage2 which has their body content defined in "AppPage1.jsp" and "AppPage2.jsp" respectively.

I need to call onLoad() function only for AppPage1. on including "onLoad()" in the body attribute of "layout.jsp" it gets called for both the JSP pages. how to call it only for AppPage1?

Regards,
Ajay.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this:

In your layout.jsp page, specify onlode="init()". In AppPage1, definie an init() function that does what you want it to do. In AppPage2 and all other pages that could be put in this tile, define an init() method that is empty and does nothing.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic