servlet,我真的要被你逼疯了,怎么改out.println的内容,可是输出就是不变。
TINA 2001-07-09 11:42:15 我生成一个servlet,里面有dopost(),doget(),程序如下
package ee;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class Servlet1 extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GB2312";
/**Initialize global variables*/
public void init() throws ServletException {
}
/**Process the HTTP Get request*/
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<font color=\"green\">");
//我注释掉这行
/* out.println("<p>The servlet has received a POST. This is the reply.</p>"); */
out.println("</font>");
}
/**Process the HTTP Post request*/
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
//我注释掉这行
/* out.println("<head><title>Servlet1</title></head>");*/
out.println("<body>");
out.println("<p>The servlet has received a POST. This is the reply.</p>");
out.println("</body></html>");
}
/**Clean up resources*/
public void destroy() {
}
}
运行时submit上去,他妈的还是显示出
The servlet has received a POST. This is the reply.
我不是已经注释掉了吗???还有在里面增加东西好像也不行,操,真的要疯了,大家救救我啊!!!!