spring controller에서 get, post 동시 허용 방법

■ spring controller에서 get, post 동시 접속을 허용하기 위해서 @RequestMapping부분 설정
method = {RequestMethod.POST,RequestMethod.GET}

 
 
 

■ 샘플 코드

@Controller
@RequestMapping("simplexml")
public class SimpleXMLController {
  @RequestMapping(
      value  = "content.do",
      method = {RequestMethod.POST,RequestMethod.GET},
      produces="application/xml;charset=utf-8")
    @ResponseBody
    public String  listSample(HttpServletRequest request) 
          throws Exception {
      return "xx";
    }
}

 
 
 

■ 톰캣서버가 시작할때 로그. POST, GET방식을 동시지원함을 알 수 있다.
정보: Mapped “{[/simplexml/content.do],methods=[POST || GET],produces=[application/xml;charset=utf-8]}” onto…