在 .net 中,您可以在任何需要的上下文中使用 Response.End()。 Java/JSP中有没有类似的功能?
谢谢,
山姆
最佳答案
根据我的经验,您必须执行以下操作:
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 servelet 处理程序返回(我假设这是您的意图)。
关于java - Java/JSP 中的 Response.End(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/570929/