Enabling the JSTL Expression Language in a JSP Page
There are two versions of the JSTL: one that enables the JSTL
expression language support and one that doesn't. JSTL
expression language support replaces the expression JSP tag with a
more convenient syntax. For example, the JSP expression:
would be written as
with expression language support enabled. The expression language is
currently available only in attribute values. Future versions will
allow its use in template text. More detailed information about the
expression language is available at
http://www.jcp.org/aboutJava/communityprocess/first/jsr052/index.html.
As mentioned in Using the Java Standard Tag Library (JSTL) in a JSP Page, there are
four tag libraries that make up the JSTL. There are two versions of
each of these libraries. That example declares the use of the four tag
libraries that do not support the expression language. Here is an
example that declares the use of the four tag libraries that do
support the expression language:
Note that the taglib directives assume the TLD files
are located in WEB-INF/tld.
<c_rt:if test='<%= request.getParameter("p") != null %>'>
<%= request.getParameter("p") %>
</c_rt:if>
<c:if test="${param.p != null}">
<c:out value="${param.p}" />
</c:if>
<%-- Core with EL --%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%-- I18N Formatting with EL --%>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%-- SQL with EL --%>
<%@ taglib uri="/WEB-INF/tld/sql.tld" prefix="sql" %>
<%-- XML with EL --%>
<%@ taglib uri="/WEB-INF/tld/x.tld" prefix="x" %>
it is very good