开发者

Custom tag not evaluating expressions; c and fmt tags are evaluating expressions

I have a .jsp page that begins with

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/mytags.tld" prefix="mytags" %>

With the header of mytags.tld having the following content:

<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>

Expressions are supported by the core tags, so that when I do something like the following:

<c:out value="${myPageBean.firstName}"/>

the expression is evaluated as expected.

However, when I try to have my custom t开发者_Go百科ag evaluate an expression, the .jsp refuses to compile.

<mytags:sayHello firstName="${myPageBean.firstName}"/>

If expressions weren't functioning anywhere on the page, I'd have an easier time sorting this out, but does it make sense that the core tags behave as expected, while my custom tags don't? I'm working with Tomcat 4.1


Since you are using Tomcat 4.1, you have JSP 1.2. EL support was introduced into JSP spec in version 2.0, so you doesn't have it. Therefore JSTL 1.0 uses its own implementation of expression language accessible via ExpressionUtil.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜