Type Status ReportMessage /customer1/deleteDescription The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.报错只有这些东西。新手找不来哪里错啊。以下贴代码!
web.xml中deleteServlet的配置<servlet>
    <servlet-name>DeleteServlet</servlet-name>
    <servlet-class>cn.action.DeleteServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>DeleteServlet</servlet-name>
    <url-pattern>/deleteServlet</url-pattern>
  </servlet-mapping>
deleteservlet编写
public class DeleteServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8");
Map<String, String []> map = request.getParameterMap();
Customer c = new Customer(); try {
BeanUtils.populate(c, map);
CustomerService cs = new CustomerService();
cs.deleteCustomer(c);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
response.sendRedirect(request.getContextPath()+"/listCustomer");
}jsp:<a href="${ pageContext.request.contextPath }/delete?id=${ c.id }">删除</a>
CustomerService编写:public void deleteCustomer(Customer c) {
CustomerDao dao = new CustomerDao();
dao.delete(c);
}
dao编写:public void delete(Customer c ) {
try {
QueryRunner runner = new QueryRunner(MyJdbcUtil.getDataSource());
String sql="delete from user where id=?";
runner.update(sql);
}catch(Exception e) {
e.printStackTrace();
throw new RuntimeException("删除客户报错啦!!");
}
}