从JSF得到警告:在我们尝试为Flash设置传出cookie时,响应已经提交. [英] Getting warning from JSF: The response was already committed by the time we tried to set the outgoing cookie for the flash

查看:229
本文介绍了从JSF得到警告:在我们尝试为Flash设置传出cookie时,响应已经提交.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个page1.jsf,在此页面中,我有一个commandButton,用于将对象放在ELFlash中,并重定向到page2.jsf.在此页面中,我通过ELFlash恢复对象.一切正常.但是,当用户停留在page2.jsf中时,对于每个ajax请求,tomcat都会显示以下警告消息:

I have a page1.jsf, in this page i have a commandButton that put an object in ELFlash, and redirects to page2.jsf. In this page i recover the object by ELFlash. Everything works fine. But while the user remains in page2.jsf, for every ajax request, tomcat shows this warning message:

20/07/2013 09:43:37 com.sun.faces.context.flash.ELFlash setCookie
WARNING: JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash.  Any values stored to the flash will not be available on the next request.

这到底是什么意思?

推荐答案

除了使用@Rafal K答案中提到的过滤器外,还可以通过在web.xml中设置上下文参数来增加响应缓冲区的大小. >

Instead of using a Filter as mentioned in @Rafal K answer, you can also increase the response buffer size by setting a context parameter in your web.xml

<!-- increase buffer size to avoid JSF1095 errors -->
<context-param>
    <param-name>javax.faces.FACELETS_BUFFER_SIZE</param-name>
    <param-value>131072</param-value>
</context-param>

大小以字节为单位,应大于最大页面.您可以通过右键单击并选择View Page Info来轻松查看Firefox中页面的大小.

The size is given in bytes and should be larger than your biggest page. You can easily check the size of your pages in Firefox by right clicking and selecting View Page Info.

这篇关于从JSF得到警告:在我们尝试为Flash设置传出cookie时,响应已经提交.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆