I am a beginner with JSF and facelets.I have been trying to create a simple l开发者_如何学运维ogin page that uses a facelet template 'master_layout.xhtml'. Everytime I click on Log In,I get the session has expired error with Generated by Mojarra/Facelets .Please help
Here is my login.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<ui:composition template="./master_layout.xhtml">
<ui:define name="content">
<h:form id="myform">
<h:panelGrid columns="2" right="100px">
<h:outputText value="Username " style="font-size: 20px; color: #C0C0C0"/>
<h:inputText id="unameTxtBox" style="position: relative; width:157px"/>
<h:outputText value="Password " style="font-size: 20px; color: #C0C0C0"/>
<h:inputSecret id="pwdTxtBox" style="position: relative; width: 157px; "/>
<h:commandButton id="loginButton" style="right:250px" value="LOG IN" action="#{loginManagedBean.validateLogin}"></h:commandButton>
</h:panelGrid>
</h:form>
</ui:define>
<ui:define name="footer">
Copyright 2011- xyzzz Inc.
</ui:define>
</ui:composition>
</html>
Looking at what your doing seems to be a straight forward form submit so either the session is being invalidated on form submit (maybe in your action or maybe there is a filter that invalidates it?) or the session timeout is set to something very short in your web.xml deployment descriptor. Have you configured the session-timeout element in your web.xml file? What value did you set it to? If it hasn't been set then the container your are using will use its default value for this.
精彩评论