This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Defining onLoad() function for a struts tiles page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Defining onLoad() function for a struts tiles page" Watch "Defining onLoad() function for a struts tiles page" New topic
Author

Defining onLoad() function for a struts tiles page

Ajay Xavier
Ranch Hand

Joined: Jan 03, 2005
Posts: 109
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.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Defining onLoad() function for a struts tiles page
 
Similar Threads
t:jscookMenu with Tiles
Tracking User's requests.
Tiles with runtime attributes - response already commited
Passing Tiles into an IFRAME.
Problem With Tiles