java.util.Connection你的类加入这个包了??

解决方案 »

  1.   

    <%@ page language="java"%>
    <%@ page contentType="text/html; charset=gb2312"%>
    <%@ page import="Photon.test.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import = "java.util.Collection" %>
    <%@ include file="trans.jsp"%>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><jsp:useBean id="product" class="java.util.Connection" scope="request" />
    <body>
    <center>
    <h1>????</h1>
    <table width=80% border="1" bgcolor="#0099CC">
    <tr bgcolor="#009966" bordercolor="#990066">
    <td>id</td><td>SerialNumber</td><td>OSA_Number</td><td>ComputerName</td><td>DataTime</td><td>Tester</td><td>Channe_No</td><td>Temperature_C</td><td>Voltage_V</td><td>OpticalPower_dBm</td><td>SeekCode</td><td>Level_dBmV</td><td>CSO_dBc</td><td>CTB_dBc</td><td>CNR_dBc</td><td>Ext1</td>
    </tr>
    <%Iterator it = product.iterator();
    while(it.hasNext())
    {
       Table2 temp = (Table2)it.next();

     out.println("<tr bordercolor=#990066>");
     out.println("<td>"+temp.getId()+"</td>");
     out.println("<td>"+temp.getTable2SerialNumber()+"</td>");
    try
       {
    out.println("<td>"+trans(temp.getOSA_Number())+"</td>");
    out.println("<td>"+trans(temp.getProducer())+"</td>");

    out.println("<td>"+trans(temp.getDescription())+"</td>");
    }
        catch(Exception e)
       {}
    out.println("</tr>");
    }%>
    </table>
    <a href="Photon_hl.html">??</a>
    </center>
    </body>
    </html>
    这个是我的JSP代码
      

  2.   

    看错了,java.util.Connection?有这个类么?
      

  3.   

    <jsp:useBean id="product" class="java.util.Connection" scope="request" />
    把这个去掉怎么样
      

  4.   

    看你上下文应该是Collection,如果是Collection的话,这样写:<jsp:useBean id="product" class="java.util.Connection" scope="request" />==><jsp:useBean id="product" type="java.util.Connection" scope="request" />
      

  5.   

    出现了这样的问题
    严重: Error compiling file: /C:/Program Files/Apache Software Foundation/Tomcat 5.0/work/Catalina/localhost/Photon_2//org/apache/jsp\search_jsp.java     [javac] Compiling 1 source fileC:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\Photon_2\org\apache\jsp\search_jsp.java:87: cannot resolve symbol
    symbol  : class Connection 
    location: package util
          java.util.Connection product = null;
                   ^
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\Photon_2\org\apache\jsp\search_jsp.java:89: cannot resolve symbol
    symbol  : class Connection 
    location: package util
            product = (java.util.Connection) _jspx_page_context.getAttribute("product", PageContext.REQUEST_SCOPE);
                                ^
    2 errors
      

  6.   

    晕~~~<jsp:useBean id="product" type="java.util.Collection" scope="request" />
      

  7.   

    晕怎么提示
    HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: bean product not found within scope
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
    org.apache.jsp.search_jsp._jspService(search_jsp.java:136)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause java.lang.InstantiationException: bean product not found within scope
    org.apache.jsp.search_jsp._jspService(search_jsp.java:91)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.