Jsf 日志记录后立即查看ExpiredException
我读到这是一个过期会话的问题,但在我的情况下,这是不可能的,因为会话刚刚打开,就抛出了异常:我进入登录页面,填写表单并提交。之后我得到了Jsf 日志记录后立即查看ExpiredException,jsf,jsf-2,viewexpiredexception,expired-sessions,Jsf,Jsf 2,Viewexpiredexception,Expired Sessions,我读到这是一个过期会话的问题,但在我的情况下,这是不可能的,因为会话刚刚打开,就抛出了异常:我进入登录页面,填写表单并提交。之后我得到了ViewExpiredException。我能做些什么来解决这个问题 这是我的web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www
ViewExpiredException
。我能做些什么来解决这个问题
这是我的web.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
<param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
<param-value>false</param-value>
<param-name>com.sun.faces.numberOfLogicalViews</param-name>
<param-value>100</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>pages/login.xhtml</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>Admin</display-name>
<web-resource-collection>
<web-resource-name>Admin</web-resource-name>
<url-pattern>/pages/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>User</display-name>
<web-resource-collection>
<web-resource-name>User</web-resource-name>
<url-pattern>/pages/user/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>admin</role-name>
</security-role>
<security-role>
<description/>
<role-name>user</role-name>
</security-role>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/pages/login.xhtml</form-login-page>
<form-error-page>/pages/errorLogin.xhtml?faces-redirect=true</form-error-page>
</form-login-config>
</login-config>
<error-page>
<error-code>403</error-code>
<location>/pages/errorLogin.xhtml</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/pages/sessionExpired.xhtml</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/pages/sessionExpired.xhtml</location>
</error-page>
javax.faces.PROJECT_阶段
发展
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
假的
com.sun.faces.numberofLogicalView
100
org.apache.myfaces.webapp.StartupServletContextListener
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
*.xhtml
30
pages/login.xhtml
管理
管理
/网页/管理员/*
管理
使用者
使用者
/页面/用户/*
用户
管理
用户
形式
/pages/login.xhtml
/pages/errorLogin.xhtml?faces redirect=true
403
/pages/errorLogin.xhtml
500
/pages/sessionExpired.xhtml
javax.faces.application.ViewExpiredException
/pages/sessionExpired.xhtml
尝试使用web.xml中的
STATE\u SAVING\u方法将保存到客户端
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
javax.faces.STATE_保存方法
客户
如果您想继续使用服务器模式,请尝试增加视图:
<context-param>
<param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
<param-value>40</param-value>
<description>Only applicable if state saving method is "server" (= default).
Defines the amount (default = 20) of the latest views are stored in session.
</description>
</context-param>
org.apache.myfaces.NUMBER\u会话中的\u视图\u
40
仅当状态保存方法为“服务器”(=默认值)时适用。
定义存储在会话中的最新视图的数量(默认值为20)。
faces配置文件中是否有与当前视图最大大小相关的配置?@LuiggiMendoza在faces-config.xml中,我只有locale-config标记到locale消息配置