DeVeLoP

thymeleaf 에서 httpServletRequest 정보 사용

freecatz 2019. 8. 28. 14:40

1. javascript

console.log('requestURL : ' + /*[[ ${#httpServletRequest.requestURL} ]]*/);
console.log('serverPort : ' + /*[[ ${#httpServletRequest.serverPort} ]]*/);
console.log('serverName : ' + /*[[ ${#httpServletRequest.serverName} ]]*/);
console.log('servletPath : ' + /*[[ ${#httpServletRequest.servletPath} ]]*/);
console.log('remoteAddr : ' + /*[[ ${#httpServletRequest.remoteAddr} ]]*/);
console.log('method : ' + /*[[ ${#httpServletRequest.method} ]]*/);
console.log('requestedSessionId : ' + /*[[ ${#httpServletRequest.requestedSessionId} ]]*/);
console.log('scheme : ' + /*[[ ${#httpServletRequest.scheme} ]]*/);
console.log('protocol : ' + /*[[ ${#httpServletRequest.protocol} ]]*/);
console.log('locale : ' + /*[[ ${#httpServletRequest.locale} ]]*/);
console.log('secure : ' + /*[[ ${#httpServletRequest.secure} ]]*/);

 

2. 결과

requestURL : http://192.168.0.10:8080/hello/world

serverPort : 8080

serverName : 192.168.0.10

servletPath : /hello/world

remoteAddr : 192.168.0.10

method : GET

requestedSessionId : 47a4fcfb-48a0-44f3-abf5-9b292eb6fd5a

scheme : http

protocol : HTTP/1.1

locale : ko_KR

secure : false