错误1:
MyEclipse中没有run on server,tomcat能运行,服务器配置确认无错,只能在IE中输入url才能运行,以前有的错误2:
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: /articledetail.jsp(2,17) quote symbol expected
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:204)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:154)
org.apache.jasper.compiler.Parser.parsePageDirective(Parser.java:352)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:481)
org.apache.jasper.compiler.Parser.parseTagFileDirectives(Parser.java:1784)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:120)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:165)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs
jsp错误部分代码:
<%@ page pageEncoding="gbk"%>
<%@ page import=java.sql.*,com.bbs.bs.* %>
<%
String strid=request.getParameter("id");
if(strid==null||strid.trim().equals("")){
out.println("Error id");
}
int id=0;
try{
id=Integer.parseInt(strid);
}catch(NumberFormatException e){
out.println("Error id again");
return;
}article a=null;Connection conn=db.getConn();
String sql="select * from article where id="+id;
Statement stmt=db.createStmt(conn);
ResultSet rs=db.executeQuery(stmt,sql);
if(rs.next()){
a=new article();
a.initFromRs(rs);
}
db.close(rs);
db.close(stmt);
db.close(conn);
if(a==null){
%>
您找的帖子不存在!
<%
return;
}
%>
MyEclipse中没有run on server,tomcat能运行,服务器配置确认无错,只能在IE中输入url才能运行,以前有的错误2:
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: /articledetail.jsp(2,17) quote symbol expected
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:204)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:154)
org.apache.jasper.compiler.Parser.parsePageDirective(Parser.java:352)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:481)
org.apache.jasper.compiler.Parser.parseTagFileDirectives(Parser.java:1784)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:120)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:165)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs
jsp错误部分代码:
<%@ page pageEncoding="gbk"%>
<%@ page import=java.sql.*,com.bbs.bs.* %>
<%
String strid=request.getParameter("id");
if(strid==null||strid.trim().equals("")){
out.println("Error id");
}
int id=0;
try{
id=Integer.parseInt(strid);
}catch(NumberFormatException e){
out.println("Error id again");
return;
}article a=null;Connection conn=db.getConn();
String sql="select * from article where id="+id;
Statement stmt=db.createStmt(conn);
ResultSet rs=db.executeQuery(stmt,sql);
if(rs.next()){
a=new article();
a.initFromRs(rs);
}
db.close(rs);
db.close(stmt);
db.close(conn);
if(a==null){
%>
您找的帖子不存在!
<%
return;
}
%>
解决方案 »
- 怎样依次显示数据库中表的所有记录?
- 请问这个网站上的pdf浏览器是用的flex开发的吗?
- 分享:查看字符串是否相同,很简洁。
- socket通讯如何判断读流成功?
- 用JAVA实现一个递归、穷举或者贪婪的算法问题。
- 我是jsp初学者,有2个问题想问大家,请大家进来看看,谢谢!
- 业务层和数据层(DAO)的增删改查(CRUD)方法到底用static的好还是非static的好?
- 在Hibernate4.3中,如何配置log4j2?或者不用配置?用hibernate自带的jboss-logging?
- jdk1.3+tomcat4.0.3+win2000 server family下的问题?100分快来拿
- 求tomcat+apach详尽配置文章或者手册!
- jodconverter转换包含标签的像<span>格式转化为pdf 转换不出pdf文件
- 急!!!2个站点之间如何共享用户?
你的问题应该是出在这里把。你仔细看看,
<%@ page import="java.sql.*,com.bbs.bs.*" %>少“”“”“”“”“”“”“”“”“”“”“”“”“”“”‘