File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes onload function in tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "onload function in tiles" Watch "onload function in tiles" New topic

onload function in tiles

Shyam Sunder

Joined: Dec 23, 2006
Posts: 24
hi friends,

my requirement is onload of page. The application should perform some validations.
we are using struts tiles, i want to load the function to call that so pls help
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It's important to realize that when you use tiles, each JSP used in the tiles template becomes a page fragment, and is no longer a complete page. For this reason, using the onload event just isn't a very good option for tiles. My suggestion would be to just put the JavaScript code inline with your HTML (not a function definition, but acutal, executable JavaScript). That way it will execute when the page loads and will work similar to using the onload event.
[ August 21, 2007: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: onload function in tiles