Fine, however I've now discovered that only the composite JSP files are compiled into servlets so ecery page will have its own servlet and hence init() method, therefore the init() will have the same code for every page and hence the same code executed evertime when I only need it the once. So I guess it'd be best to have the servlets load on deployment, however you do that.
Mike W. -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Richard Yee Sent: 09 May 2002 18:51 To: [EMAIL PROTECTED] Subject: Re: included jsp init() Mike, Override the jspInit() method like this in your JSP. <%! public void jspInit() { } %> -Richard At 06:43 PM 5/9/2002 +0100, you wrote: >Every page on my site is a jsp that is made up of various <%@ included> .jsp >files. >Though the first include is always the same. > >Does the individual includes all get compiled into there own servlet or is >it jus the finished composite? > >Because if the former, then this servlets init() method would seem to be the >best place to put anything I need setting up just the once. Especially as I >need it setting up immediately. If I put it in one my other servlets it >won't be set up soon enough. > >I know there is something that loads all servlets on deployment, maybe this >is the answer, are there any pitfals in doing this? > >Otherwise just how do I overide the jsp's init() method? > > >-- >Mike Whittaker >[EMAIL PROTECTED] >http://www.hotpud.com > >___________________________________________________________________________ >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff SERVLET-INTEREST". > >Archives: http://archives.java.sun.com/archives/servlet-interest.html >Resources: http://java.sun.com/products/servlet/external-resources.html >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
