티스토리 뷰
ex ) http://120.0.0.7:8080/test/calMax?a=8&b=10
위 URL접근시 java 단에서 HttpServletRequest 객체를 통해 접근 가능.
spring 사용시 톰캣에서 자동으로 만들어줌.
HttpServletRequest 주요 메서드는 다음과 같음.
http : getScheme()
52.78.79.190 : getServerName()
8080 : getServerPort()
test : getContextPath()
calMax : getServletPath()
/test/calMax : getRequestURI()
a=8&b=10 : getQueryString()
http://120.0.0.7:8080/test/calMax : getRequestURL()
'Spring boot > Spring' 카테고리의 다른 글
08. spring - properties 관리 (0) | 2022.07.12 |
---|---|
07. Spring(4) - RequestRejectedExcecption 핸들링 (0) | 2022.01.17 |
05. Spring - 외부경로 이미지 웹브라우저 출력 (0) | 2021.06.26 |
04. Spring - @RequestParam과 @PahtVariable (0) | 2021.06.01 |
03. @Controller와 @RestController의 차이 (0) | 2021.05.31 |
댓글