Servlet 出错: Servlet eroor :HTTP method GET is not supported by this UR 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 ). 也有可能是这样的: Servlet eroor :HTTP method GET is not supported by this UR type: Status report message: HTTP method POST 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 ). 貌似是GET或POST不被支持。 解决方法:如果你出错的是HTTP method GET is not supported by this ,则用doGet调用doPost. 如: protected void doGet(HttpServletRequest req,
HttpServletResponse resp)
…… 如果错误是HTTP method POST is not supported by this ,则用doPost调用doGet,如: protected void doPost(HttpServletRequest req,
HttpServletResponse resp)
…… 这样应该就没问题啦。 |
关于doPost或doGet调用出错
最新推荐文章于 2023-04-01 21:16:26 发布