jsp頁面打開時跳出另存頁面的對話框,請教高手原因,怎么解決?
jsp文件應該本身應該沒有問題,不知道是否是Tomcat的配置的問題?
<%@ page contentType= "html/text;charset=BIG5 "%>
<%
if(pageContext.getAttribute( "pageCount ") == null)
{
pageContext.setAttribute( "pageCount ",new Integer(0));
}
%>
<%
Integer count = (Integer)pageContext.getAttribute( "pageCount ");
pageContext.setAttribute( "pageCount ",++count);
%>
<html>
<body>
<h1> 使用pageContext,session,application對象顯示會話計數 </h1>
<br>
<form name= "form1 " method= "post " action= " ">
頁面計數: <%=pageContext.getAttribute( "pageCount ")%>
</form>
</body>
</html>
------解决方案--------------------pageContext.setAttribute( "pageCount ",++count);把++去掉:pageContext.setAttribute( "pageCount ",count);