2014년 9월 23일 화요일

[java] HttpServletRequest 에서 url/uri/port 뽑기

HttpServletRequest  request ;

request.getRequestURL()  -- > return   http://localhost/Project/project.jsp

request.getRequestURI() -- > return   /Project/project.jsp

request.getContextPath() --> return   /Project

request.getServletPath() --> return   /project.jsp

request.getRemoteHost() --> return  127.0.0.1

request.getServerName() --> return   localhost

request.getServerPort() --> 80

댓글 없음:

댓글 쓰기