• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where to place initialisation code

 
k Oyedeji
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
WHere can i place code which runs once when an application starts? Also where can I place code which i want to execute on everypage before the page is called. DO i have to include the code at the top of every page ? Is that the only way?
THanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as servlets have an init method that is run when the servlet object is first created, JSP have the jspInit method. You can override init() or jspInit() by declaring your own version in your jsp page. Look at the Javadocs for the JspPage interface.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic