我的一个jsp代码中使用了<jsp:include flush="true" page="head.jsp"></jsp:include>标签,但是这个标签必须放在最开始才能生效,如果在之前加东西都不好用,这是什么原因?我想把它放在中间可以吗?以下是head.jsp中的内容:
<%
String username = (String) request.getSession().getAttribute(
                     "username");
       if (username != null) {
              if (request.getAttribute("succ") != null) {
%>
<h2>WEB LIST</h2>
<p align="right"><font color="red" size="4">Welcome&nbsp;&nbsp;${username}</font></p>
<hr>
<%
} else {
%>
<p align="right"><font color="red" size="4">Welcome&nbsp;&nbsp;${username}</font></p>
<hr>
<%
       }
       } else {
%>
<jsp:forward page="error.jsp"></jsp:forward>
<%
}
%>
补充:如果head.jsp中是静态文本就没有问题,