在TOMCAT的SERVLET中调用HTTPCLIENT出现的奇怪问题?
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
InputStream is = request.getInputStream();
DataInputStream dis = new DataInputStream(is);
String name = dis.readUTF();
String password = dis.readUTF();
String title = dis.readUTF();
String content = dis.readUTF();
sendMsg(name, password, title, content);
}
public void sendMsg(String name, String password, String title,
String content) {
try {
HttpClient hc = new HttpClient();
//当程序做到这里的时候,下面就不会再执行了。也不会报任何的错误出来。
PostMethod post = new PostMethod(
"http://bbs.t56.net/login.asp?action=chk");
System.out.println("in the method ----");//这句不能被打印出来
//下面的代码省略
}