zoukankan      html  css  js  c++  java
  • JSP解决:Attempt to clear a buffer that's already been flushed错误(jsp:forward标签跳转空白)


    [摘要:本日正在开辟过程当中发明一个题目:正在页里中应用了jsp:forward扔错Attempt to clear a buffer that's already been flushed!! 百思没有得其解!! 谷歌之,得以下说明: 通例,先上中文论坛搜刮谜底 h]


    今天在开发过程中发现一个问题:在页面中使用了<jsp:forward>抛错Attempt to clear a buffer that's already been flushed!!

    百思不得其解!!

    google之,得如下解释:

    惯例,先上外文论坛搜索答案

    http://www.coderanch.com/t/484489/JSP/java/JSP-working

    其中有一句话,解释了这个问题的发生:

    When you forward a request to another resource.. whose response is already commited.. then it throws this exception.
    A request that is being forwarded should not have commited.

    In your case, when the JSP is being executed, it might have generated some html content before it is forwarding.

    If the server has send these html content to a client before you forward the request to another resource, then it throws an illegal state exception if you try to forward.

    As you increased the buffer size, then the server is not actually sending the generated html content to client (Till the buffer fills up).. and on forward the buffer will be cleared.

       意思大致是:当你通过forward请求另一个资源的时候,如果你的服务器已经向client响应了数据,就是所你原来未跳转之前的页面已经存在数据了(我的页面情况是:forward前面通过连接数据库查询到数据赋值给了select下拉列表了),所以就会报错,而设大缓冲区的话,服务器就不会立即响应给服务端,而是等所有页面加载完成之后,或者缓冲区满了之后才会发送响应给用户,

      我的解决办法,在jsp开头加入缓冲区设置语句

    1 <%@ page autoFlush="true" buffer="1094kb"%>

    buffer大小视实际情况来定。。

    原文出处(http://www.ithao123.cn/content-100640.html)

  • 相关阅读:
    【转】QT中添加的资源文件qrc时的路径问题小结
    【转】Qt 资源图片删除后,错误 needed by `debug/qrc_image.cpp'. Stop. 的终极解决办法
    普通类型与自定义类型之间的转化
    快速实现python c扩展模块
    关于解决python线上问题的几种有效技术
    OpenGL超级宝典笔记----渲染管线
    读python源码--对象模型
    python与c互相调用
    OpenGL超级宝典笔记----框架搭建
    python笔记(持续更新)
  • 原文地址:https://www.cnblogs.com/lianghaijie-ctw/p/6148165.html
Copyright © 2011-2022 走看看