- JSTL Quick Reference
- 日常茶飯事
- 2009. 7. 19. 19:21
JSTL 기능이 간략하게 잘 정리되어 있다.
XML Tag Library, JSTL Configuration 를 다시 한번 살펴볼 것.
[todo]
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<%-- Create the XML --%>
<x:parse var="doc">
<users>
<user id="997">
<first-name>George</first-name>
<last-name>Burdell</last-name>
</user>
<user id="998">
<first-name>Joseph</first-name>
<last-name>Blough</last-name>
</user>
</users>
</x:parse>
<%-- Define a variable holding user ID --%>
<c:set var="userId" value="${user.id}" scope="page"/>
<%-- Find the user with matching ID --%>
<x:set var="user" select="$doc//users/user[@id=$pageScope:userId]"/>
<%-- Say Hi to the user --%>
Hi <x:out select="$user/first-name"/> !
<%-- Create the XML --%>
<x:parse var="doc">
<users>
<user id="997">
<first-name>George</first-name>
<last-name>Burdell</last-name>
</user>
<user id="998">
<first-name>Joseph</first-name>
<last-name>Blough</last-name>
</user>
</users>
</x:parse>
<%-- Define a variable holding user ID --%>
<c:set var="userId" value="${user.id}" scope="page"/>
<%-- Find the user with matching ID --%>
<x:set var="user" select="$doc//users/user[@id=$pageScope:userId]"/>
<%-- Say Hi to the user --%>
Hi <x:out select="$user/first-name"/> !
java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
[todo] 예전에 datasource 를 jndi 로 되어 있는 것만 되는줄 알았는데...음 confguration 으로 두면 좋은 점이 뭘까?
Recent comment