尝试使用JSTL,但遇到以下问题:
Index.xhtml页面:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
<body>
<c:out value="Hello world!"/>
</body></html>POM:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>输出源:
<html id="document:html" lang="en" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:jsp="http://java.sun.com/JSP/Page"><head><meta content="Rendered by ICEFaces D2D" name="icefaces" />
.....
<c:out value="Hello world!"></c:out>
....</body></html>正如您所看到的,它不处理c:out,而只是将其作为文本打印出来。
发布于 2010-03-04 02:17:03
似乎是这样:
解决方案是从jstl命名空间中删除/jsp:
xmlns:c="http://java.sun.com/jstl/core“
请参阅此post。
发布于 2012-06-05 00:34:25
我可以通过在我的xhtml文件中添加xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"来解决这个问题。
或
在我的web.xml中声明它,并从我的应用程序中复制/WEB-INF/jsp中的c.tld:
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/jsp/c.tld</taglib-location>
</taglib>
</jsp-config>警告: xmlns:c="http://java.sun.com/jstl/core“抛出异常,在我的h:messages标签中收集
https://stackoverflow.com/questions/2373592
复制相似问题