📄 jstl.xtp
字号:
<document> <header> <product>resin</product> <title>JSTL standard template library for JSP</title> <version>Resin 3.0</version> <description> <p>JSTL provides standard actions for functionality most often needed by page authors. This functionality includes a core library for the most common tasks, internationalization (i18n) and text formatting, relational database access (SQL), and XML processing. </p> <p>Resin can generate more efficient code for JSTL than for other tag libraries. It is recommended that applications use JSTL as a basis for any JSP pages which can use it.</p> </description> </header> <body> <summary/> <s1 title="JSTL support in Resin is enabled by default"> <p>Because Resin automatically adds JSTL support, applications can start using JSTL by adding the taglib to the JSP without additional configuration:</p> <example title="Using c:out and c:if"><%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %><c:if test="${'${'}param.test == 'a'}"> <c:out value="The parameter is ${'${'}param.test}"/></c:if> </example> <p>For several of the more important tags, Resin's JSP compiler will generate more efficient code than is possible with the straight tag library. This "fast-jstl" can be disabled in the resin.xml:</p> <example title="Disabling fast JSTL"><caucho.com><http-server> <jsp fast-jstl='false'/> ...</http-server></caucho.com> </example> <p>Because any bugs in the tag libraries are specific to the tag, even when using Resin in combination with another JSTL implementation, please report the specific tag and tag usage for JSTL bugs.</p> </s1> <s1 title="Velocity syntax maps to JSTL core"> <p>Resin's experimental <a href="jsp-velocity.xtp">Velocity-style syntax</a> now maps directly to JSTL tags, providing a more standard basis for the Velocity-style syntax.</p> <p>Velocity-style syntax can either be enabled on a per-JSP page with <var>velocity='true'</var> or in the web-app with the <jsp> tag:</p> <example title="Enabling velocity for a web-app"><web-app> <jsp velocity='true'/> ...</web-app> </example> <p>An example use of the Velocity-style syntax would be:</p> <example title="Velocity style"><jsp:directive.page velocity='true'/>#{int count;}#<h3>A sample $\{count}</h3>#if ("foo" == params.a) <h3>Foo!</h3>#else <h3>Bar!</h3>#end </example> <p>The above page is equivalent to the following JSP page using JSTL:</p> <example title="JSTL equivalent"><%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %><jsp:scriptlet>int count;</jsp:scriptlet><h3>A sample <c:out value="${'${'}count}"/></h3><c:choose><c:when test="${'${'}'foo' == params.a}"> <h3>Foo!</h3></c:when><c:otherwise> <h3>Bar!</h3></c:otherwise></c:choose> </example> </s1> </body></document>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -