serlvet找不到页面怎么办

qq_27144221 2016-06-15 10:51:49
我的设置是对了的 可是就是找不到 怎么办 求大神赐教
...全文
126 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzj0327 2016-06-16
  • 打赏
  • 举报
回复
那你的项目路径呢
qq_27144221 2016-06-16
  • 打赏
  • 举报
回复
这个是servlet呀 就是表单提交给serlvet 然后servlet把值传给JAVA 我才好传值进mysql
菜 头 2016-06-16
  • 打赏
  • 举报
回复
项目名就叫S?
Geilymm 2016-06-16
  • 打赏
  • 举报
回复
贴代码~
  • 打赏
  • 举报
回复
qq_27144221 2016-06-16
  • 打赏
  • 举报
回复
package servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import mysql.Sql; public class S extends HttpServlet { /** * Constructor of the object. */ public S() { super(); } /** * Destruction of the servlet. <br> */ public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } /** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String age= request.getParameter("age"); String like= request.getParameter("like"); String interest= request.getParameter("interest"); String education= request.getParameter("education"); String mode= request.getParameter("mode"); String JAVA= request.getParameter("JAVA"); String mysql= request.getParameter("mysql"); String CDR= request.getParameter("CDR"); Sql c = new Sql(); c.cc(age,like,interest,education,mode); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("OK"); out.flush(); out.close(); } /** * Initialization of the servlet. <br> * * @throws ServletException if an error occurs */ public void init() throws ServletException { // Put your code here } } 就是把获取到的值传给JAVA里面
李大白白 2016-06-16
  • 打赏
  • 举报
回复
localhost:8080/s/后面都没url, 肯定404啊 你把你servlet里面的代码贴出来
luke003 2016-06-15
  • 打赏
  • 举报
回复
原因是web服务器根据请求的地址找不到对应的资源: 查看一下: 1:地址拼写是不是正确,大小写、顺序等 2:web.xml配置中的两个servlet-name是不是一致? 3:工程有没有部署?
阳光越来越暖 2016-06-15
  • 打赏
  • 举报
回复
代码贴出来撒 还有你的 url 最后怎么只有一个s?

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧