在我们用java设计网页注册时,出现如下错误
Type: Status Report
Message: HTTP method GET is not supported by this URL
Description: The method received in the request-line is known by the origin sever but noy supported by the target resource.
产生的原因:
1、继承自HttpServle 的Servlet没有重写对于请求和相应的处理方式:doGet或者doPos等方法,默认调用了父类的doGet或者doPos等方法。也就是注册的时候需要重写doPos方法,登录的时候需要写doGet方法
2,父类HttpServlet的doGet或doPost等方法覆盖了你重写的doGet或doPost等方法;
3、html中注册的时候需要指定调用doPos方法,默认时doGet方法
处理方法:
1,子类重写doGet或doPost等方法;
2、你重写的方法中不要再调用父类方法
——doGet或doPost等方法,即去掉super.doGet(request, response)和super.doPost(request,
3、在jsp文件中注明调用的方法