日期:2014-05-18  浏览次数:20875 次

请教:这是什么问题,在线等
exception  

org.apache.jasper.JasperException:   Cannot   find   any   information   on   property   'id '   in   a   bean   of   type   'inf.DB '
org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:837)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1011)
org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1062)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
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:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


代码如下:
package   inf;
import   java.sql.Connection;
import   java.sql.DriverManager;
import   java.sql.ResultSet;
import   java.sql.SQLException;
import   java.sql.Statement;
public   class   DB   {
private   static   String   url   =   "jdbc:microsoft:sqlserver://localhost:1433;databaseName=test ";
private   static   String   driver   =   "com.microsoft.jdbc.sqlserver.SQLServerDriver ";
private   static   String   userName   =   "sa ";
private   static   String   password   =   "zhsoft ";
private   static   Connection   conn   =   null;
private   static   Statement   stmt   =   null;
  static   ResultSet   rs   =   null;
  static   String   id   =   null;
  static   String   title   =   null;
  static   String   content   =   null;
  static   String   auther   =   null;
  static   String   time   =   null;
  static   String   keyword   =   null;
  static   String   type   =   null;
 
public   static   String   sql   =   "select   *   from   news   where   type= '1 ' ";
public   DB(){



try{
Class.forName(driver);
conn=DriverManager.getConnection(url,userName,password);
stmt   =   conn.createStatement();
        }
        catch   (Exception   e)   {

e.printStackTrace();
}

          &n