主题:急!急!!!
<%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="conn" class="faq" scope="page"/>
<%
ResultSet rs=null;
rs=stmt.executeQuery("select * from web");
while(rs.next())
%>
<%=rs.getString("web")%>//。。。。。faq.jsp
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>org.apache.jsp.faq</servlet-name>
<servlet-class>org.apache.jsp.faq</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.faq</servlet-name>
<url-pattern>/faq.jsp</url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>//...web.xml
import java.sql.*;
import java.io.*;
public class faq
{
String sDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr="jdbc:odbc:db_1";
Connection conn=null;
Statement stmt;
ResultSet rs;
public void faq(){
try{
Class.forName(sDBDriver);
conn=DriverManager.getConnection(sConnStr,"","");
stmt=conn.createStatement();
}
catch(Exception e){
System.err.println(e.getMessage());
}
}
public ResultSet executeQuery(String sql){
try{
rs=stmt.executeQuery(sql);
}
catch(SQLException ex){
System.err.println(ex.getMessage());
}
return rs;
}
}//...faq.java
错误:The requested resource (Servlet org.apache.jsp.faq is not available) is not available.
其它没什么问题!!这该如何改
!!!!
<jsp:useBean id="conn" class="faq" scope="page"/>
<%
ResultSet rs=null;
rs=stmt.executeQuery("select * from web");
while(rs.next())
%>
<%=rs.getString("web")%>//。。。。。faq.jsp
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>org.apache.jsp.faq</servlet-name>
<servlet-class>org.apache.jsp.faq</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.faq</servlet-name>
<url-pattern>/faq.jsp</url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>//...web.xml
import java.sql.*;
import java.io.*;
public class faq
{
String sDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr="jdbc:odbc:db_1";
Connection conn=null;
Statement stmt;
ResultSet rs;
public void faq(){
try{
Class.forName(sDBDriver);
conn=DriverManager.getConnection(sConnStr,"","");
stmt=conn.createStatement();
}
catch(Exception e){
System.err.println(e.getMessage());
}
}
public ResultSet executeQuery(String sql){
try{
rs=stmt.executeQuery(sql);
}
catch(SQLException ex){
System.err.println(ex.getMessage());
}
return rs;
}
}//...faq.java
错误:The requested resource (Servlet org.apache.jsp.faq is not available) is not available.
其它没什么问题!!这该如何改
!!!!