This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi, I have a servlet DaemonHttpServlet and want to load it during startup tomcat. I am using Socket connect applet and servlet. I know I should modify web.xml file like <servlet> <servlet-name>???</servlet-name> <servlet-class>DaemonHttpServlet</servlet-class><load-on-startup/> </servlet> is that correct? but i dont have a servlet name for it? and also is this web.xml file in Root directory? When I start tomcat, it gives me "can not load servlet name: DaemonHttpServlet. Please clarify my confusion, Thank you very much, Simon
You need to assign a servlet name - why do you say you don't have one? Just use DaemonHttpServlet as the name if you don't have any other preference. The servlet-class element must contain the fully qualified class name. If the class has no package, it is already correct as is. The class and the web.xml file can be placed in any web application. For example, if you have Tomcat installed at $TOMCAT_HOME, then the files should be $TOMCAT_HOME/webapps/test/WEB-INF/web.xml $TOMCAT_HOME/webapps/test/WEB-INF/classes/DaemonHttpServlet.class where "test" can be any web application under $TOMCAT_HOME/webapps (such as "examples", if you don't want to create a new one). ------------------ Phil Hanna Author of : JSP: The Complete Reference Instant JavaServlets
Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
Joined: Aug 16, 2000
hi, Phil, Thanks for your prompt reply. Can I load an abstract servlet (class)? Thanks, Simon