我正在使用以下罐子:-
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-compat</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-mobi</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-ace</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
<version>3.2.0</version>
</dependency>
但现在我面临新的错误:-
exception
javax.servlet.ServletException: failed to append element[tag: div; attributes: ] into #document
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
root cause
java.lang.RuntimeException: failed to append element[tag: div; attributes: ] into #document
org.icefaces.impl.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:431)
org.icefaces.impl.context.DOMResponseWriter.startElement(DOMResponseWriter.java:263)
org.icefaces.mobi.component.tabset.TabSetRenderer.encodeBegin(TabSetRenderer.java:83)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
root cause
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:391)
com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:235)
org.icefaces.impl.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:426)
org.icefaces.impl.context.DOMResponseWriter.startElement(DOMResponseWriter.java:263)
org.icefaces.mobi.component.tabset.TabSetRenderer.encodeBegin(TabSetRenderer.java:83)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
我的申请流程如下:-
1)这是索引页-
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html >
<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:mobi="http://www.icesoft.com/icefaces/mobile/component">
<h:head>
<title>title</title>
<mobi:deviceResource />
</h:head>
<h:body>
<mobi:smallView>
<ui:param name="viewSize" value="small" />
<ui:include src="fragments/mLoginPage.xhtml" />
</mobi:smallView>
<mobi:largeView>
<ui:param name="viewSize" value="large" />
<ui:include src="homepage.xhtml" />
</mobi:largeView>
</h:body>
</html>
2)然后在安卓手机请求时渲染mLoginPage.xhtml:-
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:mobi="http://www.icesoft.com/icefaces/mobile/component" >
<div id="login" class="container">
<div class="subHeader">
<f:facet name="header">
<h:panelGroup>Credentials</h:panelGroup>
</f:facet>
</div>
<div class="subContent">
<h:form id="loginForm" binding="#{loginUIBean.loginComponent}">
<h:message for="loginForm" layout="table" class="error"/>
<div style="text-align: center;">
<mobi:fieldsetGroup>
<mobi:fieldsetRow>
<h:graphicImage value="images/MP-logo.png" style="float:center;"/>
</mobi:fieldsetRow>
<mobi:fieldsetRow>
<h:outputLabel for="email" value="Login Id:"/>
<mobi:inputText id="email" autocorrect="on" singleSubmit="false" type="text" placeholder="Email Id"
value="#{loginUIBean.loginEmailId}"/>
</mobi:fieldsetRow>
<mobi:fieldsetRow>
<h:outputLabel for="password" value="Password:"/>
<mobi:inputText id="password" type="password" singleSubmit="false" placeholder="Password"
value="#{loginUIBean.password}">
</mobi:inputText>
</mobi:fieldsetRow>
<mobi:fieldsetRow>
<h:selectBooleanCheckbox value="#" immediate="true" id="saveCredentials" />
<h:outputLabel value="Save my credentials on this mobile phone."></h:outputLabel>
</mobi:fieldsetRow>
<mobi:fieldsetRow>
<mobi:commandButton value="Login" styleClass="submit" action="#{loginUIBean.login}"/>
</mobi:fieldsetRow>
</mobi:fieldsetGroup>
</div>
</h:form>
</div>
</div>
</html>
3)然后进入backing bean的登录方法成功认证:-
类LoginUiBean
public String login(){
//logic to auth.
//----
return "mDashboard";
}
4)然后我希望在屏幕上看到示例 mDashboard(或任何包含 ice-mobi 组件页面的页面):-
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:mobi="http://www.icesoft.com/icefaces/mobile/component">
<mobi:tabSet currentId="1">
<mobi:contentPane title="Ice Sailer" id="tab1"
facelet="false" client="true" >
<h:outputText value="A" />
</mobi:contentPane>
<mobi:contentPane title="Ice Breaker" id="tab2"
facelet="false" client="true" >
<h:outputText value="B" />
</mobi:contentPane>
<mobi:contentPane title="Ice Skater" id="tab3"
facelet="false" client="true" >
<h:outputText value="C" />
</mobi:contentPane>
</mobi:tabSet>
</ui:composition>
但它会抛出错误跟踪。