request.getContextPath(); 
request.getRequestURI(); 
request.getHeader("REFERER"); 
request.getRealPath("/")


request.getContextPath()는 프로젝트의 Context path명을 반환한다.

요청 : http://localhost:8080/example/test.jsp 

리턴값 : /example




request.getRequestURI()는 웹전체 경로(프로젝트명+ 파일 경로)까지 반환한다.

요청 : http://localhost:8080/example/test.jsp

리턴값 : /example/test.jsp 




request.getHeader("REFERER")는 요청을 한 부모요청의 URL주소를 반환한다.

현재 페이지:  http://localhost:8080/example/test1.do

요청 페이지 :  http://localhost:8080/example/test.do

리턴값 : http://localhost:8080/example/test.do




request.getRealPath("/")는 서버 또는 로컬의 웹애플리케애션 서버의 docBase 설정값을 반환한다.

요청 : http://localhost:8080/example/test.jsp

리턴값 : D:\Project\webapps\example\





Posted by finewoo
,

아파치 톰켓 컴파일중 오류 메시지...



According to TLD or attribute directive in tag file, attribute items does not accept any expressions



이는 JSP파일의 JSTL 선언부와 설치한 라이브러리 jstl.jar와의 버전차이에 의한 에러 메시지다.

해결법은 문서내 선언부를 버전에 맞게 변경시켜주면 된다.

JSTL 1.0
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>


JSTL 1.1
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>



..
Posted by finewoo
,