java 错误开发之旅--JasperException

今天编写的一个程序,tomcat运行报错--
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /analysePicture/getchart.jsp(1,1) Page directive has invalid attribute: encoding
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
.....

浏览Jsp页面:O(∩_∩)O~
<%@page import="ChartDirector.*" encoding="gb2312"%>
<%
try
{
out.clear();
GetSessionImage.getImage(request, response);
if (Math.max(1, 2) == 2) return;
}
catch (IllegalStateException e)
{
response.sendRedirect(response.encodeRedirectURL(
"getchart.chart?" + request.getQueryString()));
return;
}
%>

根据错误提示:去掉encoding的属性即可。
刷新页面结果即可显示。

你可能感兴趣的:(java,apache,tomcat,jsp,servlet)