我是JSF和facelets的初学者。我一直在尝试创建一个使用facelet模板'master_layout.xhtml'的简单登录页面。每次我点击登录,我得到会话已过期错误与Mojarra / Facelets生成。请帮助
这是我的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>
答案 0 :(得分:0)
看看你做什么似乎是一个直接的表单提交,所以要么会在表单提交上失效(可能在你的行动中,或者可能有一个过滤器使它失效?)或会话超时设置为某事你的web.xml部署描述符非常短。您是否在web.xml文件中配置了session-timeout元素?你设定了什么价值?如果尚未设置,则您正在使用的容器将使用其默认值。