求助 servlet大问题 servlet 的一个方法执行不了是怎么回事其它方法都能执行 就一个页面的不执行servlet 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { String action=request.getParameter("action"); if(action==null) action=""; if(action.equals("delete")) { this.delablum(request, response); } public void delablum(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { CAlbumdao ablumdao=new CAlbumdao(); CAlbum cabean=new CAlbum(); RequestDispatcher rdd=null; cabean.setInt_Id(Integer.parseInt(request.getParameter("id"))); boolean flag=ablumdao.operateCAlbum("delete",cabean); if(!flag) { System.out.println("<script>alert('删除失败!')</script>"); response.sendRedirect("admin/ablumshow.jsp"); } else { rdd=request.getRequestDispatcher("admin/ablumshow.jsp"); rdd.forward(request, response); } } 运行地址栏结果是:http://localhost:8080/HappyCom/servlet/CAServlet?action=delete&id=5 就不跳转了 原因何在 这种问题很可能就是你servlet没有重新编译,或者重新编译了但是你使用或者部署的工程一直是在用旧版本的class文件造成的 http://localhost:8080/HappyCom/servlet/CAServlet?action=delete&id=5红色的改成 method=delablum 一个是不是在web.xml配了这个servlet,还有就是可能是doGet方法也重写一下! 通过浏览器地址栏提交是get方式提交所以你的servlet里面需要有一个doGet方法然后在doGet方法里面调用doPost方法 是不是 你的请求使用doGet而你的servlet使用doPost! 哪位大侠帮忙看看,给个思路,谢谢了 一定都要看看哦! 求9呀,找一软件与源代码 关于session怎样保存值 请教JSP&JSF的符号问题 JSP和TOMCAT4.1组合使用的问题? 在jsp网页上如何实现一个下拉列表框中的项根据另一个列表框的不同选值的变化而变化 好奇怪的问题,把我的分全给你了。来研究一下 日期转换的问题给我看下: 用Json写的数据,页面上显示不出来,急死了 如何给struts1 文本框 赋值 使用java怎么将CA证书导入到PDF中
{
String action=request.getParameter("action");
if(action==null)
action="";
if(action.equals("delete"))
{
this.delablum(request, response);
}
public void delablum(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
{
CAlbumdao ablumdao=new CAlbumdao();
CAlbum cabean=new CAlbum();
RequestDispatcher rdd=null;
cabean.setInt_Id(Integer.parseInt(request.getParameter("id")));
boolean flag=ablumdao.operateCAlbum("delete",cabean);
if(!flag)
{
System.out.println("<script>alert('删除失败!')</script>");
response.sendRedirect("admin/ablumshow.jsp");
}
else
{
rdd=request.getRequestDispatcher("admin/ablumshow.jsp");
rdd.forward(request, response);
}
} 运行地址栏结果是:http://localhost:8080/HappyCom/servlet/CAServlet?action=delete&id=5 就不跳转了 原因何在
method=delablum
所以你的servlet里面需要有一个doGet方法
然后在doGet方法里面调用doPost方法