> Yeah - init() works correctly.
> I think, this is a little bit beta version of tomcat :(
>> Yeah - init() works correctly.
>> I think, this is a little bit beta version of tomcat :(
>
> On that note, what version?
This: jakarta-tomcat-5.5.9.tar.gz
> How are you launching and closing Tomcat?
startup.bat and shutdown.bat ....
Greetings
marko
Alan Krueger - 21 Jun 2005 23:46 GMT
>> On that note, what version?
>
> This: jakarta-tomcat-5.5.9.tar.gz
>
> > How are you launching and closing Tomcat?
> startup.bat and shutdown.bat ....
The following class (based on your post) with the following web.xml
produce the following log for me on Tomcat 5.5.9 under Windows XP.
I performed the following set of operations:
- start Tomcat
- access servlet
- stop Tomcat
- start Tomcat
- stop Tomcat
Note the corresponding start/end log entries.
How are you testing your version of this class? Can you post something
compilable and a copy of your web.xml?
---begin Controller.java---
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
public class Controller extends HttpServlet {
public void init() throws ServletException {
super.init();
buildController();
}
private void buildController() {
log( "start" );
}
protected void service(
HttpServletRequest req,
HttpServletResponse resp )
throws ServletException, IOException {
log( "service" );
}
public void destroy() {
try {
log( "end" );
} catch ( Exception e ) {
log( e.getMessage() );
}
}
}
---end Controller.java---
---begin web.xml---
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>Controller</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
---end web.xml---
---begin log---
Jun 21, 2005 5:26:56 PM org.apache.catalina.core.ApplicationContext log
INFO: Controller: start
Jun 21, 2005 5:26:58 PM org.apache.catalina.core.ApplicationContext log
INFO: Controller: service
Jun 21, 2005 5:27:04 PM org.apache.catalina.core.ApplicationContext log
INFO: Controller: end
Jun 21, 2005 5:32:04 PM org.apache.catalina.core.ApplicationContext log
INFO: Controller: start
Jun 21, 2005 5:32:13 PM org.apache.catalina.core.ApplicationContext log
INFO: Controller: end
---end log---