当前位置: 代码迷 >> Java Web开发 >> org.apache.jasper.JasperException: Unsupported encoding: GB2312
  详细解决方案

org.apache.jasper.JasperException: Unsupported encoding: GB2312

热度:1223   发布时间:2007-10-29 14:40:12.0
org.apache.jasper.JasperException: Unsupported encoding: GB2312
我写了个简单的jsp页面

怎么老出现上标题上的错误啊?如何解决》????求助
搜索更多相关主题的帖子: jasper  encoding  apache  Unsupported  org  

----------------解决方案--------------------------------------------------------
编码格式的问题,编码格式改成GB2312
GB2312是中文编码格式

----------------解决方案--------------------------------------------------------

楼上啥意思啊????

能再说清楚点吗?我调了一上午都弄不出来,愚昧啊


----------------解决方案--------------------------------------------------------

能把你的代码贴出来吗
还有异常代码


----------------解决方案--------------------------------------------------------
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<body>
<center><font size=4 color=red>while xunhuan</font></center><br>
<hr>
<br>
<%
int num=0;
int sum=0;
while(num<=100)
{
sum=sum+num;
num++;
}
out.println("从0加到100的总各为"+sum);
%>
</body>
</html>
----------------解决方案--------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unsupported encoding: GB2312
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.JspUtil.getReader(JspUtil.java:1059)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.


多谢各位了


----------------解决方案--------------------------------------------------------
楼主 我用JBuilder2006 和tocmat5.5 运行没有一点问题
你的服务没配好吧
----------------解决方案--------------------------------------------------------

我只装了tomcat
难道不以能运行吗??都通过tomcat测试页了啊
还需要其它什么配置吗

整不好就学不下去了


----------------解决方案--------------------------------------------------------

红色地方改成"gb2312"或"GBK"
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>

<html>
<head>


<title>登陆页面</title>
<script language="javascript">
function subm()
{
if(f.un.value=="")
{
alert("登陆账号不能为空!");
}
else if(f.up.value=="")
{
alert("登陆密码不能为空!");
}
else
{
f.action="/news/servlet/LoginServlet";
f.submit();
}

}


</script>
</head>

<body>
<form name=f method=post align=center>
登陆账号:<input type=text name=un><br>
登陆密码:<input type=password name=up><br>
<input type=button name=sub value="登陆" onclick="subm()">
<input type=reset name=res value="清空">

</form>
</body>
</html>


----------------解决方案--------------------------------------------------------
  相关解决方案