Hi!
Ich habe eine kleine App mit Tomcat 7.0 und JSF Mojarra 2.1.5 gebaut. Es gibt ein Problem, wenn ich Templates in Zusammenhang mit dem Form,siehe letzer Code, benutze.
Bitte schaut Euch mal den u.g. Code an. Wo liegt der Fehler?
Folgen Exception erhalte ich:
Code des Templates:
Code des Contents:
Danke!
Bronks
Ich habe eine kleine App mit Tomcat 7.0 und JSF Mojarra 2.1.5 gebaut. Es gibt ein Problem, wenn ich Templates in Zusammenhang mit dem Form,siehe letzer Code, benutze.
Bitte schaut Euch mal den u.g. Code an. Wo liegt der Fehler?
Folgen Exception erhalte ich:
Code:
SCHWERWIEGEND: Error Rendering View[/index.xhtml]
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2862)
at org.apache.catalina.connector.Request.getSession(Request.java:2307)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:897)
at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:155)
bla ... bla ...
Code des Templates:
Code:
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Title</title>
<link rel="STYLESHEET" type="text/css" href="application/css/application.css" />
<title>Title</title>
</h:head>
<h:body style="margin:0px;">
<table style="height:100%; width:100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="top" width="100%" colspan="2">
<ui:include src="header.xhtml" />
</td>
</tr>
<tr style=" height : 96px;" align="left">
<td id="left" style="height:100%; width : 220px;">
<ui:include src="navi.xhtml" />
</td>
<td id="content" style="height:100%;width:100%;padding-left:10px;padding-top:10px;vertical-align:top;">
<ui:insert name="content">Content</ui:insert>
</td>
</tr>
</table>
</h:body>
</html>
Code des Contents:
Code:
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
</h:head>
<h:body>
<ui:composition template="./template.xhtml">
<ui:define name="content">
<p><h:messages /></p>
<h:form id="asdf">
<h:inputText value="#{processBean.scanCode}" style="font-size:xx-large;font-weight:bold;width:200px" /><br />
<h:commandButton action="#{processBean.processScanCode}" value="OK" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
Danke!
Bronks
Zuletzt bearbeitet: