File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes where to place initialisation code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "where to place initialisation code" Watch "where to place initialisation code" New topic
Author

where to place initialisation code

k Oyedeji
Ranch Hand

Joined: Jul 07, 2002
Posts: 96
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

Joined: Mar 22, 2000
Posts: 12675
    
    5
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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where to place initialisation code
 
Similar Threads
default buffer size for all jsp files
where to place web-inf???
Redirect user to login page after session expires
session
splitting html file