数据库连接成功以后做了个简单的登陆页面,但老出现405 POST not supported的问题
1,登陆代码:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>登陆</title>
</head><body bgcolor="#FFFFFF" text="#000000">
<p align="center" > 登陆</p>
<form name="users" method="post" action="checklogin.jsp">
<table width="50%" border="1" align="center"><tr>
<td width="37%">用户名</td>
<td width="63%">
<input type="text" name="userID">
</td>
</tr><tr><td width="37%">密码</td>
<td width="63%">
<input type="password" name="password">
</td>
</tr><tr>
<td colspan="2" align="center"> 
<a href="javascript:users.submit();">提交</a>
<a href="javascript:history.back();">取消</a>
</td></tr>
</table>
</form>
</body>
</html>
2,检验代码:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"  import="java.util.*"errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>checklogin</title>
</head><body><% boolean success=true;
String userID=new;
String(request.getParameter("userID").getBytes(ISO8859_1),"GBK");
String password=new;
String(request.getParameter("password").getBytes(ISO8859_1),"GBK");
%><% Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:mysql://localhost/testmysql?user=root&password=normanwu82&useUnicode=true&characterEncoding=8859_1");
Statement stmt=con.createStatement(); %><%
 sql="select * from users where userID='"+userID+"' and password='"+password+"'";
ResultSet rs=stmt.executeQuery(sql);
 %>
 
 <%  if(success){
       session.setAttribute("userID",userID);
   success=true;
   <h1>登陆成功!</h1>
     }
     else{
  %>用户名或密码错误,请重新登陆!<% 
  
 }
  rs.close();
      con.close();
   %>
  <a href="javascript:history.back();">返回</a>
 
</body>
</html>
3,书中的检验代码中与数据库相连用的是连接池,我不太用会,就想直接连接数据库可不可以,所以我就自己写了代码,我想应该没那么难,但是却老是出现405 POST not supported的问题,请高手指点。
4,如果用连接池的话,id,scope,class等该如何设置啊?