现在又出现了这样的错误:这是找不到什么来着:是不是配置有问题呢:
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /11.jsp(3,5) Invalid standard action
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: /11.jsp(3,5) Invalid standard action
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1258)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1572)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
--------------------------------------------------------------------------------
这是firm.java文件
package firm;
import java.sql.*;
import java.io.*;
import java.util.*;
public class firm
{
public Connection conn = null;
public Statement stmt = null;
public ResultSet rs = null;
// private static String propFileName = "C:/connDB.properties";
// private static Properties prop = new Properties();
private static String dbClassName ="com.microsoft.jdbc.sqlserver.SQLServerDriver";
private static String dbUrl ="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=GuestBook";
private static String dbUser = "sa";
private static String dbPwd = "";
public static Connection getConnection()
{
Connection conn = null;
try
{
Class.forName(dbClassName).newInstance();
conn = DriverManager.getConnection(dbUrl, dbUser, dbPwd);
}
catch (Exception ee)
{
ee.printStackTrace();
}
if (conn == null)
{
System.err.println(
);
}
return conn;
}
/*
*功能:执行查询语句
*/
public ResultSet executeQuery(String sql)
{
try
{
conn = getConnection();
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery(sql);
}
catch (SQLException ex)
{
System.err.println(ex.getMessage());
}
return rs;
}
/*
*功能:执行更新操作
*/
public int executeUpdate(String sql)
{
try
{
conn = getConnection();
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
result = stmt.executeUpdate(sql);
}
catch (SQLException ex)
{
}
try
{
stmt.close();
}
catch (SQLException ex1)
{
}
}
/*
*功能:关闭数据库的连接
*/
public void close()
{
try
{
if (rs != null)
{
rs.close();
}
}
catch (Exception e)
{
e.printStackTrace(System.err);
}
try
{
if (stmt != null)
{
stmt.close();
}
}
catch (Exception e)
{
e.printStackTrace(System.err);
}
try
{
if (conn != null)
{
conn.close();
}
}
catch (Exception e)
{
e.printStackTrace(System.err);
}
}
}
这是index.jsp文件:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.sql.*,java.text.*,java.util.*,HYBTX.sys.data.*,HYBTX.info.*"%>
<jsp:userBean id="conn" scope="page" class="firm.firm"/>
<%
String sql="select * from Guest_Book";
ResultSet rs=conn.executeQuery(sql);
out.print(rs);
%>
[此贴子已经被作者于2006-9-18 13:17:29编辑过]