页面跳转是报以下错误:
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");
请问各位这是什么原因呢?
需要给doget 方法加 @Override!
或者可以去掉doget 的super~~
你如果继承了servlet,那么就要重写doget
试过了,还是没能解决,不过还是谢谢你!
试过了,还是没能解决,不过还是谢谢你!
req.getRequestDispatcher("./queryall.jsp").forward(req,resp);
解决了,把super改为this就好了