Language/JSP
태그라이브러리 URI
적외선
2012. 10. 23. 14:40
TLD 등록 방법
1. TLD 파일 경로를 지정해 준다.
1.
<%@ taglib uri="/WEB-INF/tlds/elf.tld" prefix="elf" %>
2. 라이브러리 경로를 지정해 준다.
1.
<%@ taglib uri="/WEB-INF/lib/elf.jar" prefix="elf" %>
3.
web.xml
1.
<
taglib
>
2.
<
taglib-uri
>http://elf.com/taglibs/elf<;/
taglib-uri
>
3.
<
taglib-location
>/WEB-INF/tlds/elf.tld</
taglib-location
>
4.
</
taglib
>
TLD의 uri도 맞추라고 함.
4. JSTL 사용시 web.xml에 등록하지 않아도 되는 이유
1.
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
1.
<
uri
>http://java.sun.com/jsp/jstl/core<;/
uri
>
- 참고 문서
- http://jakarta.apache.org/taglibs/site/tutorial.html#Installation_and_Deployment
- JSP best practices: Intro to taglibs
Convert scriptlets to custom tags for better JSP code