Results 1 to 4 of 4
Thread: login page jsp
Hybrid View
-
9th September 2010 13:20 #1Registered User
Join Date: Sep:2010
Location: Sofia
Posts: 2
login page jsp
, login page, :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="cyrillic">
<title></title>
</head>
<body bgcolor="#ffffcc" topmargin="0">
<from method="get" action="http://localhost:8080/School/Ocenki.jsp">
<table border="0" width="100%">
<tr>
<td width=100%>
<table border="0" width="97%" height="30">
<tr>
<td width="30%" height="13" valign="middle" align="right">
<font face="Arial" size="10" color="#800000"<b><i>
" "</i></b></font>
</td>
</tr>
</table>
<table border="1" width"100%" height="13">
<tr align="center" >
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Home.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Disciplini.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Klasove.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Otsustviq.jsp"></a></font></b></p>
</td>
<td width="95%" hieght="557" >
</tr>
</table>
<p align="center"><font face="Arial" size="2" color="#800000"> !</font></p>
<p align="center"><font face="Arial" size="2" color="#800000"> :</font><input type="text" name="username" size="20"></p>
<p align="center"><font face="Arial" size="2" color="#800000"> :</font>   ;<input type="password" name="password" nsize="20"></p>
<p align="center"><input type=submit value="" name="B1" ></p>
</body>
</html>
, JSP , . JSP :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="cyrillic">
<title></title>
</head>
<body bgcolor="#ffffcc" topmargin="0">
<from method="get" action="http://localhost:8080/School/Ocenki.htm">
<table border="0" width="100%">
<tr>
<td width=100%>
<table border="0" width="97%" height="30">
<tr>
<td width="30%" height="13" valign="middle" align="right">
<font face="Arial" size="10" color="#800000"<b><i>
" "</i></b></font>
</td>
</tr>
</table>
<table border="1" width"100%" height="13">
<tr align="center" >
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Home.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Disciplini.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Klasove.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Otsustviq.jsp"></a></font></b></p>
</td>
<td width="95%" hieght="557" >
</tr>
</table>
<table border="0" width"10%" height="43">
<tr>
<td width="15%" height="37" >
<p><b><font face="Arial" Size="4" color="#800000"><b><% out.println(new java.util.Date()); %></font></b></p>
</td>
<td width="15%" hieght="57" >
</tr>
</table>
<p align="center"><font face="Arial" size="2" color="#800000"> !</font></p>
<p align="center"><font face="Arial" size="2" color="#800000"> :</font><input type="text" name="username" size="20"></p>
<p align="center"><font face="Arial" size="2" color="#800000"> :</font>   ;<input type="password" name="password" nsize="20"></p>
<p align="center"><input type=submit value="" name="B1"></p>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page language="java" %>
<%@ page contentType="text/html;charset=windows-1251" %>
String username;
String password;
username=request.getParameter("username" );
password=request.getParameter("pass");%> "></p>
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDri ver");
Connection connect;
connect=DriverManager.getConnection("jdb c
dbc:School","","");
Statement state;
state=connect.createStatement();
String strQuery1="Select Users.Password,Users.User_Name From Users ";
ResultSet result1=state.executeQuery(strQuery1);
String user;
String pass;
while(result1.next())
{
pass=result1.getString("Password");
user=result1.getString("User_Name");
if((username.equals(user))&&(password.eq uals(pass)))
{
<jsp:forward page="/School/Home.jsp"/>
else
out.println(" !!!");
}
connect.close();
}
catch(Exception e){
out.println("done exception" +e);
}
</form>
</body>
</html>
:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="cyrillic">
<title></title>
</head>
<body bgcolor="#ffffcc" topmargin="0">
<from method="get" action="http://localhost:8080/School/Ocenki.jsp">
<table border="0" width="100%">
<tr>
<td width=100%>
<table border="0" width="97%" height="30">
<tr>
<td width="30%" height="13" valign="middle" align="right">
<font face="Arial" size="10" color="#800000"<b><i>
" "</i></b></font>
</td>
</tr>
</table>
<table border="1" width"100%" height="13">
<tr align="center" >
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Home.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Disciplini.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Klasove.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Otsustviq.jsp"></a></font></b></p>
</td>
<td width="95%" hieght="557" >
</tr>
</table>
<p align="center"><font face="Arial" size="2" color="#800000"> !</font></p>
<p align="center"><font face="Arial" size="2" color="#800000"> :</font><input type="text" name="username" size="20"></p>
<p align="center"><font face="Arial" size="2" color="#800000"> :</font>   ;<input type="password" name="password" nsize="20"></p>
<p align="center"><input type=submit value="" name="B1" onClick="location.href='http://localhost:8080/School/Ocenki.jsp'" ></p>
</body>
</html>
, jsp , .
, - ?
-
9th September 2010 13:26 #2
<form> . , ,
: XaMaB; . 0.42
In God we Trust (all others must submit a X.509 certificate). , ()
-
9th September 2010 15:22 #3Registered User
Join Date: Sep:2010
Location: Sofia
Posts: 2
,
---------- 15:22 ---------- 14:15 ----------
, jsp:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="cyrillic">
<title></title>
</head>
<body bgcolor="#ffffcc" topmargin="0">
<from method="get" action="http://localhost:8080/School/Ocenki.htm">
<table border="0" width="100%">
<tr>
<td width=100%>
<table border="0" width="97%" height="30">
<tr>
<td width="30%" height="13" valign="middle" align="right">
<font face="Arial" size="10" color="#800000"<b><i>
" "</i></b></font>
</td>
</tr>
</table>
<table border="1" width"100%" height="13">
<tr align="center" >
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Home.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Disciplini.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Klasove.jsp"></a></font></b></p>
</td>
<td width="25%" height="13" >
<p><b><font face="Arial" Size="5" color="#800000"><b><a HREF=
"http://localhost:8080/School/Otsustviq.jsp"></a></font></b></p>
</td>
<td width="95%" hieght="557" >
</tr>
</table>
<table border="0" width"10%" height="43">
<tr>
<td width="15%" height="37" >
<p><b><font face="Arial" Size="4" color="#800000"><b><% out.println(new java.util.Date()); %></font></b></p>
</td>
<td width="15%" hieght="57" >
</tr>
</table>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page language="java" %>
<%@ page contentType="text/html;charset=windows-1251" %>
<%
String username;
String password;
username=request.getParameter("username" );
password=request.getParameter("pass");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDri ver");
Connection connect;
connect=DriverManager.getConnection("jdb c
dbc:School","","");
Statement state;
state=connect.createStatement();
String strQuery1="Select Users.Password,Users.User_Name From Users where User_Name='"+username+"'";
ResultSet result1=state.executeQuery(strQuery1);
String pass;
pass=result1.getString("Password");
if(password.equals(pass))
{
out.println(" ");
}
else
out.println(" !!!");
}
catch(Exception e){
out.println("done exception" +e);
}
/*out.println(username);
out.println(password); */
%>
</form>
</body>
</html>
exception:
done exceptionjava.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)'; file already in use.
. ?
-
12th September 2010 04:29 #4
space: Class.forName("sun.jdbc.odbc.JdbcOdbcDri ver");
jdbc .
null NullPointerException equals-a. null "" ...
.Thre are 10 kinds of people in this world - people who know binary, and those who don't.
-, .




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in