【发布时间】:2012-05-13 10:16:10
【问题描述】:
我是第一次使用 java 服务器页面,但我遇到了标签问题。如果相关的话,我也在 Eclipse 中工作。
我得到的具体错误是:
org.apache.jasper.JasperException: /Query.jsp (line: 5, column: 0) No tag "choose" defined in tag library imported with prefix "c"
问题是,是一个带有前缀c的标签“选择”...
我在使用通常推荐的 url 时遇到了问题,其中一些似乎已经过时,所以我下载了标准标签并将它们提取到我的 WEB-INF/tags 目录中。
我的 jsp 文件开头为:
<%@ page contentType="text/html" import="beans.*" %>
<%@ taglib prefix="c" tagdir="/WEB-INF/tags/c.tld" %>
<%@ taglib prefix="sql" tagdir="/WEB-INF/tags/sql.tld" %>
<%@ taglib prefix="fn" tagdir="/WEB-INF/tags/fn.tld" %>
<c:choose>
....
c.tld 有:
...
<tag>
<description>
Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by
<when> and <otherwise>
</description>
<name>choose</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
<body-content>JSP</body-content>
</tag>
我猜测某处存在某种配置错误,但我完全不知道它可能在哪里。
【问题讨论】:
-
请将鼠标放在问题下方的
[jstl]标签上方,直到弹出一个框,然后单击其中的信息链接。