JSTL 1.1 설치법

62 views
Skip to first unread message

샤키(sharky)

unread,
May 6, 2013, 10:36:08 PM5/6/13
to kor...@googlegroups.com
JSTL 설치 및 설정   


전용뷰어 보기

* JSTL(Java Standard Tag Library)

1) http://jakarta.apache.org/site/downloads/downloads_taglibs.html 에서 아래 둘중에 하나를 다운 받는다
    (문서는 알아서 참고하세요)
Standard 1.0 Taglib
Standard 1.1 Taglib    

2) 압축해제

3) lib 폴더 안에 있는 것들은 (해당 프로젝트의) WEB-INF/lib 폴더에, tld 폴더 전체를 WEB-INF/ 에 복사

4) web.xml 화일 수정

<taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>

5) 테스트 코드

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>Simple Example</title>
</head>
<body>

<c:set var="browser" value="${header['User-Agent']}"/>
<c:out value="${browser}"/>

</body>
</html>
 

샤키(sharky)

unread,
May 7, 2013, 9:33:15 PM5/7/13
to kor...@googlegroups.com
[web.xml] 추가 수정

<jsp-config>
< taglib>
    < taglib-uri>jstl/core< /taglib-uri>
    < taglib-location>/WEB-INF/tld/c.tld< /taglib-location>
  < /taglib>
  < taglib>
    < taglib-uri>jstl/xml< /taglib-uri>
    < taglib-location>/WEB-INF/tld/x.tld< /taglib-location>
  < /taglib>
  < taglib>
    < taglib-uri>jstl/fmt< /taglib-uri>
    < taglib-location>/WEB-INF/tld/fmt.tld< /taglib-location>
  < /taglib>
  < taglib>
    < taglib-uri>jstl/sql< /taglib-uri>
    < taglib-location>/WEB-INF/tld/sql.tld< /taglib-location>
  < /taglib>  
</jsp-config>
Reply all
Reply to author
Forward
0 new messages