【发布时间】:2016-07-20 01:43:17
【问题描述】:
我正在使用 ice faces 1.8 应用示例。
pom是:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>tab</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.icefaces.netbeans.rave</groupId>
<artifactId>wyswyg-appbase</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>just-ice</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-comps</artifactId>
<version>1.8.2</version>
<exclusions>
<exclusion>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-facelets</artifactId>
<version>1.8.2</version>
<exclusions>
<exclusion>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.14</version>
</dependency>
</dependencies>
</project>
web.xml 是:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>
faces-config.xml 为空:
如果我把它放在上面
<application>
<view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
</application>
应用程序抛出此异常:
java.lang.RuntimeException:com.sun.faces.config.ConfigurationException:
无法创建 'com.icesoft.faces.facelets.D2DFaceletViewHandler
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
</faces-config>
index.xhtml 是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ace="http://www.icesoft.com/icefaces/component"
xmlns:ice="http://www.icesoft.com/icefaces/component"
>
<h:form>
<h:outputLabel value="Hello, world"/>
<ice:outputText value="hello world ice outputtext"/>
</h:form>
</html>
问题是当我运行它并生成 xhtml 时,只呈现 h 标签“Hello, world”。 冰面标签 (ice:outputText) 未呈现,因为在 xhtml 代码中,它仍然是原样。
我尝试了过去 4 天在网上找到的所有发布的解决方案,但对我没有任何帮助。
我尝试了 ICEFaces 3.x、不同的名称空间、tomcat 6/7 等
我正在使用 Intellij 14 和 Tomcat 6.0.44
请告诉我,如果有人发现我做错了/遗漏了什么,以及您是否需要我的应用/环境中的任何其他信息。
非常感谢!
【问题讨论】: