404错误,The requested resource is not available.

要实现的功能,点击删除就能删除学生信息
web.xml的配置:

删除链接:

servlet代码:
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 bean.CrtlSql;//这是实现数据库连接的类
public class DeleteStuServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public DeleteStuServlet() {
super();
}
public void destroy() {
super.destroy();
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
CrtlSql con=new CrtlSql();
String stu_id=request.getParameter("stu_id");
String sql="delete from student where stu_id='"+stu_id+"'";
con.con();//数据库连接
con.update(sql);
response.sendRedirect("ifram/stu_info.jsp");
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
public void init() throws ServletException {
}
}
相关推荐
HTTP_Status_404(The_requested_resource_is_not_available)的几种解决方案_补充
HTTP_Status_404(The_requested_resource_is_not_available)的几种解决方案_补充
HomeBrew 下载时出现 404 错误
今天在macbook上安装软件时,homebrew出现了404的错误: curl: (22) The requested URL returned error: 404 Not Found Error: An exception occurred within a child process: DownloadError: Failed to download resource “ant–bcel” 经过查看,homebrew寻找的该软件版本写的是 6.1.13版本,而当我找到该软件网站时,发现它已经是6.1.14版本了,所以应该是homebrew没有及时更新,所以使用以下命令更新一下ho
Spring MVC 404 Not Found无错误日志的解决方法
主要为大家详细介绍了Spring MVC 404 Not Found无错误日志的解决方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
IIS HTTP 错误 404.17 – Not Found 解决方法
错误提示如下图: 出现这种情况的原因通常是因为先安装了Framework,后安装的IIS; 运行cmd,输入: 代码如下:C:\Windows\Microsoft.NET\Framework\V4.0.30319\aspnet_regiis -i 注:C:\Windows\Microsoft.NET\Framework\V4.0.30319\ 是 netframework安装对应的路径; 如下图: 注册成功后,重启一下iis, 理论上应可以解决导致404.17 not found 的大部分问题了; Win7中IIS出现“HTTP 错误 404.17 – Not Foun
IIS HTTP 错误 404.17 - Not Found 解决方法
主要介绍了IIS出现Errore HTTP 404.2 - Not Found" IIS 7.5 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理问题的解决方法,需要的朋友可以参考下


Web 开发
