今天在第一次接触使用“验证码”功能时,在执行时出现了异常信息:
严重: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response。
在网上搜索之后的解决方法是:
在生成验证码的jsp文件末尾添加两句话
out.clear();
out = pageContext.pushBody();