Java / JSP中的Response.End() [英] Response.End() in Java/JSP
本文介绍了Java / JSP中的Response.End()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在.net中,您可以在任何上下文中使用Response.End()。 Java / JSP中是否有类似的功能?
In .net you have the ability to Response.End() in any context you want. Is there similar functionality in Java/JSP?
谢谢,
Sam
推荐答案
根据我的经验,您必须执行以下操作:
In my experience you have to do the following:
out.flush(); // Send out whatever hasn't been sent out yet.
out.close(); // Close the stream. Future calls will fail.
return; // Return from the JSP servelet handler.
注意:
这将不在函数内部工作,因为你最终会从函数返回而不是从JSP servlet处理程序返回(我假设是你的意图)。
NOTE:
This will not work inside a function because you'll just end up returning from the function but not from the JSP servelet handler (which I'm assuming is your intention).
这篇关于Java / JSP中的Response.End()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文