Java部分异常及处理

来源:互联网 发布:linux 不保存退出 编辑:程序博客网 时间:2024/05/21 15:49

1、java.lang.IllegalStateException: Cannot forward after response has been committed

Answer:You aren't returning after the forward when the login and/or password is not been supplied. It's a common misconception among starters that the forward() method magically terminates the code execution and jumps out of the method somehow. This is thus not true. You have to return from the method and stop the execution of the remnant of the code yourself.

原文:http://stackoverflow.com/questions/7951331/java-lang-illegalstateexception-cannot-forward-after-response-has-been-committe


大致意思就是forward()方法执行之后下边的代码还是会继续执行,需要在下边自己加上return

0 0