严重: Servlet.service() for servlet jsp threw exception
严重:Servlet.service()forservletjspthrewexceptionorg.apache.jasper.JasperException:Unab...
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 9 in the generated java file
Syntax error on token "import", Identifier expected after this token
jsp:
<%@ page pageEncoding="GB18030"%>
<%@ page import="java.sql.*,com.my.bbs.*,java.util.*,"%>
<%!private void tree(List<Article> articles, Connection conn, int id, int grade) {
String sql = "select * from article where pid = " + id;
Statement stmt = DB.createStmt(conn);
ResultSet rs = DB.executeQuery(stmt, sql);
try {
while (rs.next()) {
Article a = new Article();
a.initFromRs(rs);
a.setGrade(grade);
articles.add(a);
if (!a.isLeaf()) {
tree(articles, conn, a.getId(), grade + 1);
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DB.close(rs);
DB.close(stmt);
}
}%>
这怎么解决啊,百度的方法不行啊= = 展开
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 9 in the generated java file
Syntax error on token "import", Identifier expected after this token
jsp:
<%@ page pageEncoding="GB18030"%>
<%@ page import="java.sql.*,com.my.bbs.*,java.util.*,"%>
<%!private void tree(List<Article> articles, Connection conn, int id, int grade) {
String sql = "select * from article where pid = " + id;
Statement stmt = DB.createStmt(conn);
ResultSet rs = DB.executeQuery(stmt, sql);
try {
while (rs.next()) {
Article a = new Article();
a.initFromRs(rs);
a.setGrade(grade);
articles.add(a);
if (!a.isLeaf()) {
tree(articles, conn, a.getId(), grade + 1);
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DB.close(rs);
DB.close(stmt);
}
}%>
这怎么解决啊,百度的方法不行啊= = 展开
2个回答
2015-04-18
展开全部
<%@ page import="java.sql.*,com.my.bbs.*,java.util.*,"%>
这行有问题。把最后一个逗号去掉。
这行有问题。把最后一个逗号去掉。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询