Results 1 to 4 of 4

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;<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 cdbc: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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;<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 , .

    , - ?

  2. #2
    XaMaB's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 20,387
    <form> . , ,
    : XaMaB; . 0.42

    In God we Trust (all others must submit a X.509 certificate). , ()

  3. #3
    Registered 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 cdbc: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.

    . ?

  4. #4
    ****** koshera's Avatar
    Join Date: Sep:2003
    Location: Sammamish, WA, USA
    Posts: 1,507
    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.
    -, .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |