Why SpringMVC Request method 'GET' not supported?
05:15 26 Jul 2010

I trying @RequestMapping(value = "/test", method = RequestMethod.POST) but is error

Code is

 @Controller
 public class HelloWordController {
 private Logger logger = LoggerFactory.getLogger(HelloWordController.class);

 @RequestMapping(value = "/test", method = RequestMethod.POST)
 public String welcome() {
  logger.info("Spring params is welcome");
  return "/WEB-INF/jsp/welcome";
 }

}

web.xml is


This is Spring MVC DispatcherServlet
SpringMVC DispatchServlet
org.springframework.web.servlet.DispatcherServlet

  SpringContext
  contextConfigLocation
  classpath*:springmvc.xml

1

  
SpringMVC DispatchServlet
/

and springmvc.xml is

index.jsp is

I input submit botton brower is error

HTTP Status 405 - Request method 'GET' not supported type Status report

message Request method 'GET' not supported

description The specified HTTP method is not allowed for the requested resource (Request method 'GET' not supported).

java spring spring-mvc