随
随便看看
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是tomcat5.0.24版本,jdk1.4.2_04,微软的jdbc驱动,在tomcat中配置好数据库连接池后,写了一个测试的jsp文件,结果出错,下面是出错信息:org.apache.jasper.JasperException: /mytest.jsp(16,48) The attribute prefix javado
es not correspond to any imported tag library
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:125)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:185)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:156)
org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:421)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:386)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:170)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
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:810)
下面是jsp代码,是不是有错?
<%@ page ContentType="text/html;charset=GB2312"%>
<%@ page import="javax.naming.Context"%>
<%@ page import="javax.sql.DataSource"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.until.*%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<%
DataSourse ds=null;
try{
Context iniCtx=new InitialContext();
Context envCtx=(Context)iniCtx.lookup("java:comp/env");
ds=(DataSourse)envCtx.lookup("jdbc/TestDB");
if(ds!=null) Connection cn=ds.getConnection();
if(cn!=null) Statement stmt=cn.createStatement();
ResultSet rs=stmt.excuteQuery("select * from student");
out.print("<Table Border>");
out.print("<TR>");
out.print("<TH width=100>"+"学号");
out.print("<TH width=100>"+"姓名");
out.print("<TH width=50>"+"性别");
out.print("<TH width=50>"+"成绩");
out.print("</TR>");
while(rs.next()){
out.print("<TR>");
out.print("<TD >"+rs.getInt(1)+"</TD>");
out.print("<TD >"+rs.getString(2)+"</TD>");
out.print("<TD >"+rs.getSting(3)+"</TD>");
out.print("<TD >"+rs.getInt(4)+"</TD>");
out.print("</TR>") ;
}
out.print("</Table>");
}
catch(SQLExeption e){}
rs.close();
cn.close();
ds.close();
%>
</BODY>
</HTML>
es not correspond to any imported tag library
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:125)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:185)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:156)
org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:421)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:386)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:170)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
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:810)
下面是jsp代码,是不是有错?
<%@ page ContentType="text/html;charset=GB2312"%>
<%@ page import="javax.naming.Context"%>
<%@ page import="javax.sql.DataSource"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.until.*%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<%
DataSourse ds=null;
try{
Context iniCtx=new InitialContext();
Context envCtx=(Context)iniCtx.lookup("java:comp/env");
ds=(DataSourse)envCtx.lookup("jdbc/TestDB");
if(ds!=null) Connection cn=ds.getConnection();
if(cn!=null) Statement stmt=cn.createStatement();
ResultSet rs=stmt.excuteQuery("select * from student");
out.print("<Table Border>");
out.print("<TR>");
out.print("<TH width=100>"+"学号");
out.print("<TH width=100>"+"姓名");
out.print("<TH width=50>"+"性别");
out.print("<TH width=50>"+"成绩");
out.print("</TR>");
while(rs.next()){
out.print("<TR>");
out.print("<TD >"+rs.getInt(1)+"</TD>");
out.print("<TD >"+rs.getString(2)+"</TD>");
out.print("<TD >"+rs.getSting(3)+"</TD>");
out.print("<TD >"+rs.getInt(4)+"</TD>");
out.print("</TR>") ;
}
out.print("</Table>");
}
catch(SQLExeption e){}
rs.close();
cn.close();
ds.close();
%>
</BODY>
</HTML>