为了测试:request.getReqestDispatcher("test02.jsp").forward(request,response);
写了个程序,一直出现如题异常,最终解决:
在调用它们之前,都不能有内容已经被实际输出到了客户端。如果缓冲区中已经有了一些内容,这些内容将被从缓冲区中清除。
因为myeclipse
自动生成的代码忘记删除,所以导致该错误。
api:
forward
void forward(ServletRequest request,
ServletResponse response)
throws ServletException,
IOException
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows one servlet to do preliminary processing of a request and another resource to generate the response.
For a RequestDispatcher
obtained via getRequestDispatcher()
, the
ServletRequest
object has its path elements and parameters adjusted to match the path of the target resource.
forward
should be called before
the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an
IllegalStateException
. Uncommitted output in the response buffer is automatically cleared before the forward.
The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the
ServletRequestWrapper
or
ServletResponseWrapper
classes that wrap them.
Parameters:
request
- a ServletRequest
object that represents the request the client makes of the servlet
response
- a ServletResponse
object that represents the response the servlet returns to the client
Throws:
ServletException
- if the target resource throws this exception
IOException
- if the target resource throws this exception
IllegalStateException
- if the response was already committed
分享到:
相关推荐
description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet execution threw an exception root cause ...
This document provides different tools and techniques useful for debugging audio issues encountered in Linux-based systems. The document is mostly focused on the Android operating system, but some of ...
Keil v5 Error: Encountered an improper argument 个人实测解决办法 实测运行正常咯,再也不出现仿真关不了debug情况了
Download the attached file and extract it to the folder C:\Keil_v5\UV4. If you have installed PK51 to a different folder, you need to adapt the path accordingly. The file UV4.exe is replaced with ...
Error Encountered an improper argument 真实测试过
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server ...
Keil-MDK Error Encountered an improper argument 问题解决办法实测有效,此问题属于keil的软件bug,在mdk5.2x版本中普遍出现,最新的mdk5.26版本也没有解决此软件bug,所以分享此解决办法让更多人免于受此问题困扰...
Keil v5 Error Encountered an improper argument ,解决keil5关闭debug时弹出的 Encountered an improper argument 问题,亲测有用
keil升级5.25pre(临近几个...会提示Error: Encountered an improper argument 主要解决办法就是替换UV4.exe,可以将低版本中的UV4.exe直接替换 具体操作看:https://blog.csdn.net/u011624093/article/details/80880708
WD 硬盘工具,强大的工具管理.
解决在Keil仿真时,退出仿真出现Encountered an improper argument错误。解决办法,将附件添加到kei的安装目录中即可C:\Keil_v5\UV4。将原来的替换即可
Socket编程中的Error捕获的中文解释,包括错误代码和中文释义
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server ...
The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server ...
PHP has encountered an Access Violation at 7C94BD02解决方法
In this scenario, since T1 believes it locks the entire table, it might inadvertently make changes to the same row that T2 thought it has locked exclusively. In a multigranular locking environment, ...
This program has encountered an error (Use the arrows keys to scroll) Error see log for more info PartedUtil failed with message error can’t have a partition outside the disk Unable to read ...
win7_64eclispe插件 解决An internal error occurred during: "Map/Reduce location status updater". org/codehaus/jackson/map/JsonMappingException 重新编译包
building workspace has encountered a problem