- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用rich:fileUpload 上传文件的页面。对于较小的文件,这可以正常工作,但是对于较大的文件 (+80MB),我通常会收到 ViewExpiredException。我已经尝试寻找解决方案,但我没有找到任何解决此问题的方法。
@Component
@Scope("request")
public class Bean {
...
}
<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root omit-xml-declaration="true"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0">
<rich:panel styleClass="formPanel">
<h:form id="docForm">
<ui:param name="doc" value="#{pb.newDoc}" />
<h:panelGrid columns="2" columnClasses="formTableLabel, formTableField">
...
<h:outputLabel for="fileUpload" value="#{labels['file']}*" />
<h:panelGroup>
<rich:fileUpload required="true" ajaxSingle="true"
fileUploadListener="#{pb.uploadDocument}" id="fileUpload"
autoclear="false" immediateUpload="true" noDuplicate="true"
addControlLabel="#{labels['browse']}">
<a4j:support event="onclear" reRender="fileUpload" ajaxSingle="true"
oncomplete="$('docForm:fileUpload').component.currentInput.enable()"/>
</rich:fileUpload>
<h:message for="fileUpload" styleClass="errorMessage"
showDetail="false" showSummary="true" />
</h:panelGroup>
...
...
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.BUFFER_SIZE</param-name>
<param-value>500000</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
<context-param>
<description>
Context parameter specifically for facelets, lists available tag libraries.
</description>
<param-name>facelets.LIBRARIES</param-name>
<param-value>
/WEB-INF/taglibs/authorization.taglib.xml;
/WEB-INF/taglibs/taskscreen.taglib.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/config/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>forceparser</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Pretty Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>FacesServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<welcome-file-list>
<welcome-file>start/start.jspx</welcome-file>
</welcome-file-list>
<error-page>
<error-code>500</error-code>
<location>/error.jspx</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/access-denied.jspx</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/expired.jsf</location>
</error-page>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
...
SEVERE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@22075431]
2012-09-13 16:43:46,945 [qtp130437654-18] ERROR org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter - Exception in the filter chain
javax.servlet.ServletException: viewId:/data/includes/doc.jspx - View /data/includes/doc.jspx could not be restored.
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:521)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1207)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:367)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:433)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:118)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:490)
at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:179)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:928)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:370)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:862)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:116)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:331)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:115)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:64)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:110)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at com.doc.filter.IEFilter.doFilter(IEFilter.java:33)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at com.doc.portal.filter.ExceptionRedirectFilter.doFilter(ExceptionRedirectFilter.java:28)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:110)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at com.doc.filter.UTF8Filter.doFilter(UTF8Filter.java:20)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1178)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:433)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:118)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:456)
at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:179)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:928)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:370)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:862)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:116)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:115)
at org.eclipse.jetty.server.Server.handle(Server.java:330)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:557)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:947)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:736)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:413)
at org.eclipse.jetty.server.bio.SocketConnector$Connection.run(SocketConnector.java:229)
at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnection.run(SslSocketConnector.java:648)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:435)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.faces.application.ViewExpiredException: viewId:/data/includes/doc.jspx - View /data/includes/doc.jspx could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:189)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:102)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
... 75 more
最佳答案
这可能不是您想听到的,但标准 HTTP 协议(protocol)在上传大文件时效果不佳。通常在对等套接字应用程序中,客户端和服务器都可以保持连接健康并在大传输期间保持一切 Activity 。然而,对于 HTTP 和 Web,客户端通常唯一有状态的就是它的 cookie。客户端无法知道它的 cookie 是否仍然有效(更正:除非它们被明确设置为在特定日期过期),直到将它们提供给服务器并得到带有结果的响应。
因此,正因为如此,服务器需要对 session 的生命周期强加一个时间线,并且在该时间过去之后,它会为 session 折腾状态信息。由于典型的 Internet 连接的上传速度往往比下载速度稍慢,而且在等待大文件上传时 session 失效并不罕见。
你有三个选择:
关于java - Richfaces 文件上传 ViewExpiredException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12421610/
我尝试关注不同的帖子,了解如何在 GlassFish 3.1 上的 Mojarra 2.1.0(使用 RichFaces 4)中处理 ViewExpiredException。但是我在 web.xml
我让一些带有表单的选项卡打开,当我按下命令按钮时( session 过期一段时间后)我收到一个 java 脚本警报说: serverError: class javax.faces.applicati
一周前,我研究了 ViewExpiredException,并阅读了几篇关于它的文章。 viewExpiredException JSF How to control web page caching
我想弄清楚如何防止 Session Fixation在 Glassfish 3.1 中的 JSF 登录表单上。 使用 Servlets 很容易做到,所以我试图对 JSF 做同样的事情(基于这个问题:R
我有一个使用rich:fileUpload 上传文件的页面。对于较小的文件,这可以正常工作,但是对于较大的文件 (+80MB),我通常会收到 ViewExpiredException。我已经尝试寻找解
我有包装器 PrimeFaces.ajax.AjaxResponse 来处理 ViewExpiredException(重新加载页面): var handleViewExpired = functio
JSF 应用程序可以在 session 过期时抛出 ViewExpiredException。当您的系统上有 guest 时,此事件将很常见。因此,应用程序将处理此事件而不会给访客带来任何麻烦,如下所
我正在 Glassfish v3 上开发一个 JSF 2.0 应用程序,我正在尝试处理 ViewExpiredException。但无论我做什么,我总是收到 Glassfish 错误报告,而不是我自己
我在我的项目中使用 JSF 2.0 和 Primefaces。 我有两个 xhtml 页面,即 Cars.xhtml 和 Bikes.xhtml。 我正在使用 ViewScoped 支持 bean。
我的 h:commandButton "Login"有问题:当我使用 @ViewScoped 并按下此按钮时,会出现 ViewExpiredException,但是当我使用 @SessionScope
出于记录目的,我有兴趣检测 JSF 应用程序中何时发生 session 超时。 我已经实现了一个 PhaseListener 来检查用户是否已登录并且其 session 是否已处于 Activity
在我的网络应用程序中,当 session 过期并且用户发起请求(完整页面或 AJAX)时,用户将被重定向到登录页面,并显示 session 已过期的消息。问题是,当登录页面保持打开的时间足够长以致 s
我已将以下内容放入我的 web.xml 中: javax.faces.application.ViewExpiredException /expiredIndex.jsf
我们最近将一个主要平台从 jsf 1.2 升级到了 2.0。升级后,我们每小时都会收到几个 ViewExpiredException 错误。通过阅读该主题,这似乎是 session 过期时的预期异常,
我有一个 Web 应用程序当前部署在 Wildfly 22 上,使用 JSF 2.3 和 OpenJDK 11。我目前正在将登录页面从 j_security_check 迁移到编程登录,按照这篇文章中
我有一个 jsf 1.2 应用程序,索引页中有一些链接。该链接可通过在新的 jquery 对话框中单击来打开。每个链接都会在不同的对话框中打开我的应用程序的新页面,因此,应用程序可以在单个页面的多个对
我按如下方式设置我的网络应用程序: javax.faces.application.ViewExpiredException /WEB-INF/include/vi
我们的应用程序使用的是 SUN JSF 1.2、WebSphere 7.0,我们仅在负载测试期间收到 ViewExpiredException 我已浏览以下链接 javax.faces.applica
我遇到一个问题,每次我重新部署我的应用程序时,任何现有 session 都会中断并且请求会导致 ViewExpiredException .相关问题或外部邮件列表/论坛帖子中的建议似乎都无法解决此问题
我使用 jsf、prettyfaces 和 hibernate 创建了此网页我环顾四周,大多数人说这个错误是因为缓存大多数人在登录、注销并尝试重新登录后发现此错误但我在登录时发现此错误,并且当我尝试导
我是一名优秀的程序员,十分优秀!