| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 594 人关注过本帖
标题:[求助]JSP运行出错改了两天了,还是没好
只看楼主 加入收藏
xjw007
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-28
收藏
 问题点数:0 回复次数:1 
[求助]JSP运行出错改了两天了,还是没好

type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 17 in the jsp file: /inputsub.jsp
Generated servlet error:
String literal is not properly closed by a double-quote


	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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

搜索更多相关主题的帖子: JSP 运行 
2006-05-28 13:22
xjw007
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-28
收藏
得分:0 

源文件代码:
<%@ page import="java.util.Date,java.lang.*" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.lang.Integer" %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 2003">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>提交</title>
</head>

<body>
<table align="left">
<%
String QType="";
int answer=0;
int i=0;
byte[] tmpbyte;
String ctemp;
String CColor;
Connection conn=null;
Statement stmt;
ResultSet rs=null;
String[] Context=request.getParameterValues("Context");
String[] KeyA=request.getParameterValues("KeyA");
String[] KeyB=request.getParameterValues("KeyB");
String[] KeyC=request.getParameterValues("KeyC");
String[] KeyD=request.getParameterValues("KeyD");
String[] KeyE=request.getParameterValues("KeyE");
if (Context[0].equals(""))
{
out.print("<div align=\"center\">\n");
out.print("<center>");
out.print("<table border=\"1\" cellspacing=\"0\" width=\"288\" height=\"153\" cellpadding
=\"0\" bordercolordark=\"#FFFFFF\" bordercolorlight=\"#000000\">\n");
out.print("<tr>");
out.print("<td width=\"280\" align=\"center\" height=\"18\" bgcolor=\"#C0C0C0\">注意</td>\n");
out.print("</tr>");
out.print("<tr>\n");
out.print("<td width=\"280\" align=\"center\" height=\"127\">\n");
out.print("<div align=\"left\">\n");
out.print("<table border=\"0\" cellspacing=\"1\" width=\"101%\" height=\"86\">\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"></td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"16\">题目内容不能为空!!</td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"></td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\">
<input type=\"button\" OnClick=\"JavaScript:history.back()\" value="返回\"></td>\n");
out.print("</tr>\n");
out.print("</table>\n");
out.print("</div>\n");
out.print("</td>\n");
out.print("</tr>\n");
out.print("</table>\n");
out.print("</center>\n");
out.print("</div>\n");
}
else
{
answer=0;
if(KeyA!=null)
{
answer=answer+10000;
i=i+1;
}
if(KeyB!=null)
{
answer=answer+1000;
i=i+1;
}
if(KeyC!=null)
{
answer=answer+100;
i=i+1;
}
if(KeyD!=null)
{
answer=answer+10;
i=i+1;
}
if(KeyE!=null)
{
answer=answer+1;
i=i+1;
}
if(i==0)
{
out.print("<div align="\center\">\n");
out.print("<center>");
out.print("<table border=\"1\" cellspacing=\"0\" width=\"288\" height=\"153\"
cellpadding=\"0\" bordercolordark=\"#FFFFFF\" bordercolorlight=\"#000000\">\n");
out.print("<tr>");
out.print("<td width=\"280\" align=\"center\" height=\"18\" bgcolor=\"#C0C0C0\">注意</td>\n");
out.print("</tr>");
out.print("<tr>\n");
out.print("<td width=\"280\" align=\"center\" height=\"127\">\n");
out.print("<div align="\left\">\n");
out.print("<table border=\"0\" cellspacing=\"1\" width=\"101%\" height=\"86\">\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"></td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"16\">没有答案!</td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"></td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"><input type=\"button\"
OnClick=\"JavaScript:history.back()\" value=\"返回\"></td>\n");
out.print("</tr>\n");
out.print("</table>\n");
out.print("</div>");
out.print("</td>");
out.print("</tr>\n");
out.print("</table>\n");
out.print("</center>\n");
out.print("</div>\n");
}
else
{
QType="T";
if(i>1)
{
QType="N";
}
tmpbyte=Context[0].getBytes("ISO8859_1");
ctemp=new String(tmpbyte,"GBK");
String t1=Integer.toString(answer);
String t2=Integer.toString(i);
try{
String sql="Insert Into question(Context,Key,Type) VALUES('"+ctemp+"',"+t1+",'"+QType+"')";
String url="jdbc:odbc:test";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection(url);
stmt=conn.createStatement();
stmt.execute(sql);

out.print("<div align="\center\">\n");
out.print("</center>");
out.print("<table border=\"1\" cellspacing=\"0\" width=\"288\" height=\"153\"
cellpadding=\"0\" bordercolordark=\"#FFFFFF\" bordercolorlight=\"#000000\">\n");
out.print("<tr>");
out.print("<td width=\"280\" align=\"center\" height=\"18\" bgcolor=\"#C0C0C0\">注意</td>\n");
out.print("</tr>");
out.print("<tr>\n");
out.print("<td width=\"280\" align=\"center\" height=\"127\">\n");
out.print("<div align="\left\">\n");
out.print("<table border=\"0\" cellspacing=\"1\" width=\"101%\" height=\"86\">\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"></td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"16\">正确添加!!</td>\n");
out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\"></td>\n");
   out.print("</tr>\n");
out.print("<tr>\n");
out.print("<td width=\"100%\" align=\"center\" height=\"18\">&nbsp;
&nbsp;<a href=\"input.html\">继续</a>&nbsp;&nbsp;</td>\n");
out.print("</tr>\n");
out.print("</table>\n");
out.print("</div>");
out.print("</td>");
out.print("</tr>\n");
out.print("</table>\n");
out.print("</center>\n");
out.print("</div>\n");
}catch(SQLException ex)
{
tmpbyte=ex.getMessage().getBytes("GBK");
ctemp=new String(tmpbyte,"ISO8859_1");
out.print(ctemp);
}
}
}
%>
</table>
</body>
</html>

2006-05-28 13:23
快速回复:[求助]JSP运行出错改了两天了,还是没好
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021424 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved