【疑难解答】JSP中使用include标签
2014-10-06 15:20
531 查看
<span style="font-family: arial, 'courier new', courier, 宋体, monospace; white-space: pre-wrap;">Servlet.service() for servlet [action] in context with path [/s] threw exception [java.lang.IllegalStateException: Exception occurred when flushing data] with root cause</span>java.io.IOException: Stream closed
当出现这种错误时,
1:首先检查
页面跳转后有没有加入return;
2:被包含的页面不要有多余的标签
去掉被包含页面<html>,<head>
但是某些JSP标签可以留下
例如
<%@page import="com.utils.RefererUtils"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% if(RefererUtils.isReferer(request, response)){ response.sendRedirect(request.getContextPath()+"/index.jsp"); return; } %>
3.检查inclde标签是否用错
1.<jsp:include page="" /> 这是动态包含
2.<%@include file="" %> 这是静态包含如果你使用其中的一个标签出错的话,不妨换一个标签试试相关文章推荐
- 使用jsp include标签包含静态页面出现的乱码问题
- 使用jsp的include标签解耦页面中共同部分
- jsp include标签使用
- JSP中使用哪个标签允许向<include/>标签传递参数
- JSP —— include标签的使用
- [JQuery]关于使用jsp:include标签及<%@ include标签时要注意的事项
- 关于使用jsp:include标签及<%@ include标签时要注意的事项
- JQuery关于使用jsp:include标签需要注意的事
- JSP中使用<include/>标签传递参数
- JSP中使用哪个标签允许向<include/>标签传递参数
- ADF应用应避免使用jsp:include标签
- 使用JSTL开发jsp自定义标签开发
- freemarker使用webwork UI标签 - 或者JSP标签库
- 使用eclipse在jsp上显示水晶报表(五)viewer标签应用
- 使用JSP标签库验证用户的输入(1)
- 学习用jsp:include标签,出现了一个错误
- 使用JSTL开发jsp自定义标签开发---迭代标签
- jsp标签的使用(转)
- jsp标签的使用
- jsp/servlet:标签使用详解