运行第一个servlet? <form action="/sevlet/SomeServlet" method="Get">好象就OK了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的Servlet还没有每调用呢!Servlet是需要触发的,浏览器下载index.html后不会自动执行你的Servlet.改改的你的html文件,比如: <Html><head><Title>示列表单</Title></head><body bgcolor="#FDF5E6"><a href="/sevlet/SomeServlet">用Post方法发送数据的表单</a></Form></body></html> 点击超链就会调用你Servlet的doGet()方法了! type Status reportmessage /sevlet/SomeServletdescription The requested resource (/sevlet/SomeServlet) is not available.关键是找不到servlet为什么呢? 再详细说明一下你把 servlet 存在什么目录下。 我把servlet存在TOmcat的root的自建的servlet的目录下 注意你的程序public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ PrintWriter out = response.getWriter(); out.println("hello world"); }你只实现了doGet方法,所以用post时不行,解决的方法1、在你的表单里,设为method=get2、加一个方法public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ doGet(request,response); }祝你好运。 另外,你的表单必须要提交到那个servlet去阿修改你的HTML文件如下<form action="/sevlet/SomeServlet" method="Post"><input type=submit value='提交'></Form> 好大的风: 程序的改动,我已经进行了修改,但是,我现在觉得是路径的问题。 我的servlet不在classpath的目录下面吧,我的服务器是NT4,但是,我不知如何设置classpath环境变量呢? 上面的朋友你好: 你的问题搞定了没有,我也碰到了此类问题,请指叫,谢谢!!!! [email protected] 求高手帮我看看这程序怎么回事的 请问一个SQL startup.bat sql server 2000中迫切左外连接和左外连接有什么区别? 大虾给详细讲下,我这虾米不胜感激! 郁闷死了,帮我看下 这里使用include代码哪里错了,在线等 Eclipse3.3应该加载什么版本的Aptana CSS表格边框样式 struts2标签<s:if> 和EL表达式问题! 求高手。 很期待各位能解答一个javamail的问题 Ajax从数据库中动态提取出来的数据必须在下一行输出吗?怎么改变位置,让它在同一行输出 急!急!谁知道怎么做实时消息,谢谢各位了! 我想将数据库里的数值表现出来,该如何做??
<Html>
<head>
<Title>示列表单</Title>
</head>
<body bgcolor="#FDF5E6">
<a href="/sevlet/SomeServlet">用Post方法发送数据的表单</a>
</Form>
</body>
</html>
点击超链就会调用你Servlet的doGet()方法了!
type Status reportmessage /sevlet/SomeServletdescription The requested resource (/sevlet/SomeServlet) is not available.
关键是找不到servlet为什么呢?
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException{
PrintWriter out = response.getWriter();
out.println("hello world");
}
你只实现了doGet方法,所以用post时不行,解决的方法
1、在你的表单里,设为method=get
2、加一个方法
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException{
doGet(request,response);
}
祝你好运。
修改你的HTML文件如下
<form action="/sevlet/SomeServlet" method="Post">
<input type=submit value='提交'>
</Form>
程序的改动,我已经进行了修改,但是,我现在觉得是路径的问题。
我的servlet不在classpath的目录下面吧,我的服务器是NT4,但是,我
不知如何设置classpath环境变量呢?
你的问题搞定了没有,我也碰到了此类问题,请指叫,谢谢!!!!
[email protected]