Sorry, the JSP page looks like this:

<%@ page import="java.io.*" contentType="text/xml" %>
<%!
public void jspInit(){
        System.out.println("Hello World");
}
%>
<%
        System.out.println("Normal call");
        out.println("<HTML>Hi there</HTML>");
%>


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Mark Lines-Davies
Sent: 01 March 2002 15:12
To: [EMAIL PROTECTED]
Subject: jspInit and load-on-startup


Hello

I would like to have a JSP page loaded by Tomcat 3.3 when it starts up.

I have added <load-on-startup> to the web.xml file and my JSP page looks
like this:

<%@ page import="java.io.*" contentType="text/xml" %>
<%!
public void
Init(){
        System.out.println("Hello World");
}
%>
<%
        System.out.println("Normal call");
        out.println("<HTML>Hi there</HTML>");
%>

I assumed that when Tomcat starts, I would see the "Hello World" message
displayed in my Tomcat console window. Instead, I see a message saying
"LoadOnStartupInterceptor: Initializing JSP with JspWrapper".

If I then make a browser call to this JSP page I get

Hello World
Normal call

and subsequent calls just give "Normal call".

I guess I have misunderstood what <load-on-startup> is for....?

regards

Mark Lines-Davies



*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to