공부/웹
JSP/js 경로(contextPath) 가져오기, UNI code EN/DECODING
오피스엑소더스
2019. 8. 21. 11:10
가져온 경로를 저장해서 임의의 작업 후에 저장된 경로로 다시 이동할 수 있다.
- 로그아웃 등
경로에 한글이 포함되어 있는 경우(파라미터 등) UNI코드로 변환되는 문자열을 decoding할 수 있다.
1. JSP
> request 경로 받아오는 메소드
ContextPath : request.getContextPath()
ServletPath : request.getServletPath()
URI : request.getRequestURI()
URL : request.getRequestURL()
param : request.getQueryString()
(Map)param : reqeust.getParameterMap()
> 한글 유니코드 EN/DECODING
java.net.URIDecoder.decode( String uriPattern )
2. js
> request 경로 받아오는 방법
> 한글 유니코드 EN/DECODING
var str = decodeURI( String uriPattern )