I have writen a servlet name test.servlet.Display, and its configure file
Display.servlet . I found that the destroy() method never run. I have tried to force
it to run in 3 way:
1.modify the Display.servlet
2.recompile the test.servlet.Display
3.stop Webphere service in NT
but all failed. "[Display]destroy" was not printed in default_server_stdout.log .
What is the matter?
the servlet:
package test.servlet;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Display extends HttpServlet
{
String p1;
public Display() {
super();
}
public void destroy()
{
System.out.println("[Display]destroy");
}
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
{
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
out.println("p1=" + p1 + "with destroy");
System.out.println("[Display]DoGet p1=" + p1);
out.flush();
out.close();
}
public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
{
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
out.println("doPost");
System.out.println("[Display]DoPost");
out.flush();
out.close();
}
public void finalize()
{
System.out.println("[Display]finalize");
}
public void init(ServletConfig config) throws
javax.servlet.ServletException
{
p1 = config.getInitParameter("P1");
}
}
the configure:
<?xml version="1.0"?>
<servlet>
<code>test.servlet.Display</code>
<init-parameter name="P1" value="Ken"/>
</servlet>
___________________________________________________________________________
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