java, jsp, spring, egov

jsp에서 request의 get, post 여부 확인

디츠 2016. 2. 19. 10:16
1. request.getMethod() 함수를 이용해서 찍어보면 (request 는 HttpServletRequest 클래스의 객체) GET인지, POST인지 확인 할 수 있다.
 
2. request.getMethod().equals("GET")일 경우 GET으로 넘어오는 경우엔 true를 반환하고
request.getMethod().equals("POST")일 경우 POST로 넘어오는 경우엔 true를 반환 하겠죠.