我是 ICEFACES 的初学者,尝试使用一些 ICEFACES 组件成功运行我的第一个 ICEFACES 屏幕。开始使用。我正在使用 ICEFACES 1.8.2。
我从这个链接复制了我的 web.xml 的内容:
http://res.icesoft.org/docs/v1_8_2/htmlguide/gettingstarted/SessionRendererTutorial11.html#1054095
下面是 faces-config.xml 文件:
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<application>
<view-handler>
com.icesoft.faces.facelets.D2DFaceletViewHandler
</view-handler>
</application>
</faces-config>
下面是Test.jsp屏幕内容:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="ice" uri="http://www.icesoft.com/icefaces/component"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<ice:outputText id="txtHello" value="Hello ICEFaces"></ice:outputText> <br>
<ice:panelGroup title="Hello"></ice:panelGroup>
</f:view>
</body>
</html>
当我使用以下 URL 运行应用程序时:
http://localhost:8046/TestMojarra/faces/Test.jsp
我遇到了一个例外:
javax.servlet.ServletException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
com.icesoft.faces.context.DOMResponseWriter.<init>(DOMResponseWriter.java:154)
com.icesoft.faces.context.DOMContext.createTemporaryDOMResponseWriter(DOMContext.java:182)
com.icesoft.faces.context.DOMContext.getDOMContext(DOMContext.java:228)
com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:89)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:840)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:151)
com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:151)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
但是,如果我从上面的 jsp 文件中注释掉该<ice:panelGroup>
行,屏幕就会显示出来。
请让我知道问题出在哪里。