一个页面application.jsp
<%@ page language="java" contentType="text/html;charset=gb2312 " %>
<% int count=0;
String counter_name=request.getParameter("counter_name");
try
{
count=Integer.parseInt((application.getAttribute(counter_name).toString()));
}
catch(Exception e)
{
}
out.println(" HAVE VISITED "+count+"times");
count++;
application.setAttribute(counter_name,new Integer(count));
%>
另一个时test_application.jsp
<%@ page language="java" contentType="text/html;charset=gb2312"
import="java.sql.*" errorPage="" %>
<html>
<head>
<title> use the calculater </title>
</head>
<body>
test the application page !@!!
<jsp:include page="application.jsp" >
<jsp:param name="counter_name" value="test_application.jsp" />
</jsp:include>
</body>
</html>
运行test_application 时出现提示:
org.apache.jasper.JasperException: Unsupported encoding: gb2312
谢谢
<%@ page language="java" contentType="text/html;charset=gb2312 " %>
<% int count=0;
String counter_name=request.getParameter("counter_name");
try
{
count=Integer.parseInt((application.getAttribute(counter_name).toString()));
}
catch(Exception e)
{
}
out.println(" HAVE VISITED "+count+"times");
count++;
application.setAttribute(counter_name,new Integer(count));
%>
另一个时test_application.jsp
<%@ page language="java" contentType="text/html;charset=gb2312"
import="java.sql.*" errorPage="" %>
<html>
<head>
<title> use the calculater </title>
</head>
<body>
test the application page !@!!
<jsp:include page="application.jsp" >
<jsp:param name="counter_name" value="test_application.jsp" />
</jsp:include>
</body>
</html>
运行test_application 时出现提示:
org.apache.jasper.JasperException: Unsupported encoding: gb2312
谢谢
**看到了么?上面用**标记的地方多了一个空格,去掉就行了