Hi Luca, For your first question, check out the DTD of web.xml, the definition of the <servlet> element is given as below:
<!ELEMENT servlet (icon?, servlet-name, display-name?, description?, (servlet-class | jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)> This clearly shows, that you can either give a <servlet-class> OR a <jsp-file> after the servlet-name tag. Hence, to answer your question, the web.xml would look like this: <servlet> <servlet-name>MyServlet</servlet-name> <jsp-file>MyJSP.jsp</jsp-file> <init-param> <param-name>configFile</param-name> <param-value>my.conf</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> This should do the trick. Regarding your second question, servlet and generated servlets out of JSPs are accessed by multiple threads at the same time. Hence, there is really no need for having multiple instances of a servlet. Every new client accesses the same servlet instance thru' a new service thread. Still, if you need to have multiple instance for synchronization reasons, explore the SingleThreadModel interface. I do not think you are looking for this, but just in case. Best Regards Sanjeev -----Original Message----- From: Luca Ventura [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 24, 2002 3:47 PM To: [EMAIL PROTECTED] Subject: How to run multiple instances of JSP pages/servlets in Tomcat? Hello everybody! In Tomcat 4.x I don't know how I can call automatically a JSP page when the web application starts. I mean...in Tomcat 4.x there is the web.xml file where I can declare: <servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>MyServlet</servlet-class> <init-param> <param-name>configFile</param-name> <param-value>my.conf</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> In this way the servlet "MyServlet" is called when the web app. starts... Can I do the same thing with a jsp page (the jsp page should be like a servlet, in fact it is translated into a servlet when it is called the first time)? If yes, in which way? Another questions: how can I tell the Web Server "Tomcat" to activate more instances of a servlet or a JSP page? Thanks a lot to everybody! Luca ___________________________________________________________________________ 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