This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.