我用tomcat,在jsp中调用servlet的doPost方法,
如果我改成调用doGet方法时没有错误,
可是我调用doPost时总是出错。
我用WebRun也不好用。老大们我快疯了。
如果我改成调用doGet方法时没有错误,
可是我调用doPost时总是出错。
我用WebRun也不好用。老大们我快疯了。
解决方案 »
- Java内部类对象对外部类对象引用的问题.
- eclipse导入web工程 我就不信不得!
- Object中包含hashCode()这个方法么?
- 如何在javadoc中隐藏interface中的字段?
- 问个JSP短信平台的问题
- java连接数据库表时对其插入所遇到的困难,请各位高手伸出你们的帮助之手!
- 我在做东西的时候遇到几个问题,请大家帮忙解决~~
- java利用JNA调用C# 封装的DLL文件运行一段时间后出错
- 那位能提供你运行成功的JAVA 环境的软件下载的具体地址和具体运行环境设置方法???
- 关于jdk1.3.1的环境变量在win2000下的设置(一定给分的)救救我把
- 我愿意捐出1000分 来解决这个问题
- why?
import javax.servlet.http.*;
import java.io.*;
import java.util.*;public class ServletCommit extends HttpServlet
{
private static final String CONTENT_TYPE = "text/html; charset=GBK";
//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("<html>");
out.println("<head><title>ServletCommit</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
} 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>ServletCommit</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()
{
}
}
<form name="form1" method="post" action="/servlet/commit.ServletCommit">
i cannot undertand it clearly.
tanx!
HttpServletResponse response)
throws IOException, ServletException
{
doGet(request, response);
}
我有个朋友在学jsp,我教她教了快一个月,直到今天早上,她才连到她的数据库,并可以看到那个jsp的正确显示!
原因,她用tomcat4.0我没用过,我只记得跟3。2的有区别,今天叫她用tomcat3.2试试看,结果可以了!
由于一直通过msn和qq教的,很费劲,但终于又拉了一个到java世界了:))