首页 新闻 会员 周边

jsp页面跳转报错

0
悬赏园豆:10 [已关闭问题] 关闭于 2013-06-01 10:08

页面跳转是报以下错误:

HTTP Status 405 - HTTP method GET is not supported by this URL


type Status report

message HTTP method GET is not supported by this URL

description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).

页面跳转按钮如下:

<input type="button" value="查看用户信息" onclick="window.open('./queryAllServlet')" >

servlet如下:

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
   throws ServletException, IOException {
 super.doGet(req, resp);
 }

 @Override
 protected void doPost(HttpServletRequest req, HttpServletResponse resp)
   throws ServletException, IOException {  
 
  req.getRequestDispatcher("./queryall.jsp");

请问各位这是什么原因呢?

打酱油的茬的主页 打酱油的茬 | 初学一级 | 园豆:117
提问于:2013-05-27 09:13
< >
分享
所有回答(2)
0

需要给doget 方法加 @Override!

或者可以去掉doget 的super~~

 

你如果继承了servlet,那么就要重写doget 

 

Beyond-bit | 园豆:2885 (老鸟四级) | 2013-05-27 10:44

试过了,还是没能解决,不过还是谢谢你!

支持(0) 反对(0) 打酱油的茬 | 园豆:117 (初学一级) | 2013-06-01 10:00

试过了,还是没能解决,不过还是谢谢你!

支持(0) 反对(0) 打酱油的茬 | 园豆:117 (初学一级) | 2013-06-01 10:01
0

req.getRequestDispatcher("./queryall.jsp").forward(req,resp);

MiracleSnow | 园豆:232 (菜鸟二级) | 2013-05-27 11:52

解决了,把super改为this就好了

支持(0) 反对(0) 打酱油的茬 | 园豆:117 (初学一级) | 2013-06-06 14:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册