[英]What is the use of response.sendRedirect()?
while using respone.sendRedirect("page.jsp")
it was showing java.lang.IllegalStateException
, while in some pages it was executing properly. 在使用respone.sendRedirect("page.jsp")
它显示java.lang.IllegalStateException
,而在某些页面中,它正在正确执行。 How can I avoid this exception? 如何避免这种异常? For more details I passed yesterday a question that was simillar to this. 有关更多详细信息,我昨天通过了一个与此类似的问题。
respone.sendRedirect
will throw java.lang.IllegalStateException
if your response is already committed. 如果您的响应已经提交,则respone.sendRedirect
将引发java.lang.IllegalStateException
。 You have either manually flush the buffer or it was automatically flushed because it was full. 您可以手动刷新缓冲区,也可以自动刷新缓冲区,因为缓冲区已满。 To avoid this, either increase the buffer size and make sure that you are not flushing it or call respone.sendRedirect
early. 为避免这种情况,请增加缓冲区大小并确保不刷新它,或者尽早调用respone.sendRedirect
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.