How to create a login............

Hi
i am new to using JSP and i don't know how to create a user login page. A DBHandler holds all the connection and SQL queries to my database. Within the DBHandler i have Login.java which carries the login info for the JDBC connection. Login.java code is below. Can i use something like for my user login?
public class Login
private String username;
private String password;
Constructor to create a new login object
@param u valid database username.
@param p valid database password.
public Login(String u, String p)
     username = u;
     password = p;
Gets the username.
@return the username as a string
protected String getUser()
     return username;
Gets the password
@return the password as a string.
protected String getPassword()
     return password;
Thanks

With what you have, you can have a login page that is simply a basic HTML page with form fields for login and password. You can post this form to another JSP page to actually do the validation. Once you've validated that the login/password they provided you can then either forward back to the logn page if it is incorrect, or store an attribute in the session to record that they have successfully logged in, and forward to the main page using session.setAttribute("user", userName) or something like that.
Then every page can include a simply jsp that checks to see if the attribute "user" exists in the session, and if not, it can forward to the login page. When the user clicks logout, a simple call to session.invalidate() will invalidate the session, and any further attempts to access pages would result in being forwarded back to the login page.

Similar Messages

  • How to create a login interface in labview PDA module?

    How to create a login interface in labview PDA module? So that it checks with a list of usernames and passwords and allow to go to another VI?
    Anu

    Anu,
    I've attached a really short example that does something like what you're talking about.  It just compares the user's username and password a pre-determined username and password and then "logs the user in" based on that comparison.  Like Greycat said, you probably want to store this username and password info in some sort of file on the PDA that's in an encrypted format for both security and flexibility of your application.
    I hope this helps,
    Justin D.
    Applications Engineer
    National Instruments
    Attachments:
    LoginVI.vi ‏17 KB

  • Does anyone here knows how to create a login page thru JDBC?

    Anyone here knows how to create a login page which connect to database thru JDBC but not JDBC-ODBC bridge?

    Hi..pls you'll do people here a great good if you could explain yourself better..!
    Anyway if you are trying to connect to an Oracle Database you dont need the jdbc-odbc bridge as oracle provides a special driver for java applets/applications that is "the thin driver" and the "oci driver"..so if you are connecting to Oracle your connection will look like this:
    Class.forName("oracle.jdbc.driver.OracleDriver"); //not sun.jdbc.odbc.JdbcOdbcDriver
    Connection con = DriverManager.getConnection ("blah blah, blah");
    no need for the jdbc-odbc bridge.
    I hope i've answered your question.
    Thanks.

  • How to create a login portlet?

    anyone can tell me how to create a login portlet?
    I'm created a JSR286 portlet use "weblogic.security.services.Authentication",that can login only in the portlet application.The portal can't Authentication.

    Hi.
    Portlets are consumed via WSRP 2.0 (Remotelly).
    I recommend you create an ADF Task Flow for your login process of your Portal instead of a Portlet.
    Regards.

  • How to create a login module

    Hi Everyone.
    How to create a login module which like www.sdn.sap.com
    the module is on the top left corner

    http://help.sap.com/saphelp_nwce10/helpdata/en/46/3ce9402f3f8031e10000000a1550b0/frameset.htm

  • How to create a LOGIN Form & LOGIN ID & PASSWORD for END USERS

    hi,
    i have just created a Database and Forms & Reports using developer 6i.
    now i want to deleiver that Database to end users, but i dont know that how to create a LOGIN Form for the end users and also i want to assign each user a Login ID & Password.
    Plz help me to solve out this problem.

    1. Create the user accounts on the database CREATE USER ... IDENTIFIED BY...
    2. Grant CONNECT Role to the Users
    3. in the main form (the one which is being called initially at runtime) in the ON-LOGON-Trigger create a CALL_FORM() to the Login Form
    4. The Login Form will be called; build a Block with username, password and a Button
    5. In the Button call the LOGON Built-In
    6. Control will be passed to the initially called form again
    I also noticed a thread in here explaining this in more detail...
    Message was edited by:
    user434854

  • How to create a login to users in PHP

    How to create a login for users to access their data,
    currently I can only see the first user everytime I login even with
    a different username. I know I need session stuff but don't know
    how to use, add or where to put them in.
    Thanks in advanced.

    I also am wrestling with the same problem. Session variables
    have not worked. I have determined that if the GET method is used,
    then the recordset of the users records are there. If the POST
    method is used, the recordset is blank. It appears to be something
    inherent in the Log In User behavior.
    I am trying to have a customer log in and then only see their
    particular inventory records. I do not want them be directed to a
    page with a listing of all the various customers and then select
    from that. Not suitable at all.
    If I find an answer, will let you know.
    Thanks and good luck,
    Dale :-)

  • How to create Jaas Login module !! Urgent

    <b>Hi developers</b>
                        I want to make some changes in logon messages. Right now we are getting only error <b>user authentication failed </b> on the portal even if user is locked or some other reason is there for failed authentiaction. I want proper message should be displaying based on user input. For it I hope its good to <b>create Jaas logon module</b> so that i can modify it accordingly .
    kindly if any one can give me way out , its urgent.
    how to create it step by step. it would be highly appriciable.
    any inputs are appriciated .
    Thanks in advance
    <b>Abhay</b>

    Hi Abhay,
    1.) Every question is "urgent"... Please read https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement - section "Use a Good Subject Line"
    2.) For JAAS Login Modules examples, see https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4d65ed90-0201-0010-3aba-9209836e8242
    Hope it helps
    Detlev

  • How to create a Login/Password page?

    Anyone know how to create a page where I can say - create a hyperlink on a text file and by clicking on that text file it takes them to a new page with a login screen? (from there I would create a page that once logged in takes to another page). just interested in the login page as default. I know i can password protect, create new site, etc. thats not what im looking to do....thanks.

    Drop.io is an easy to use, online file sharing service that provides users with a simple and private way to share images, video, audio, documents and other digital content through unique, user-created and controlled sharing points called 'drops' which are are protected from search engines...
    http://drop.io/about
    ...And there's a how-to video here:
    http://drop.io/howto

  • Plz help! How to create a login page

    Hi!
    is there anyone who knows to create a login page from java

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>login1.html</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <SCRIPT LANGUAGE="JavaScript">
    function validate(){
    if(document.form1.text1.value.length<1){
    alert("Please enter UserName");
    return false;
    if (document.form1.pwdtext.value.length<3){
    alert("please enter the Password");
    return false;
    return true;
    </SCRIPT>
    </head>
    <body>  <br>
    <form method="get" name="form1" style="" action="./logdb1" enctype ="text/plain" onSubmit = "return validate(this);">
    <p> </p><p> UserName:    <input type="text" maxlength="20" name="text1"></p><p> Password:      <input type="password" maxlength="20" name="pwdtext"></p><p>            <input type="submit" value="Login" name="loginbutton">    <input type="reset" value="Cancel" name="cancelbutton"></p><p> ForgotPassword?     SignUp</p>
    </form>
    </body>
    </html>

  • How to create a login system

    I need to create a login system for an application.  The application will be a Flex front-end connecting to a Postgres database through ColdFusion.  I can connect to my database but cannot find a good way to check user credentials and save data in a session.  Can someone provide some sample code or suggestions (I have already reviewd Bruce Phillips blog on the subject).  I assume this is a standard activity in Flex but cannot find a lot of guidance.  Any help would be appreciated.  Details follow:
    The use case is quite simple:
    Assumptions:
    -the user has an account and supplies correct information
    -Flex can connect to the Postgres databse through ColdFusion datasource.
    Actions:
    User supplies username, password and role and clicks submit button.  System validates that the username/password/role combination matches and displays a viewstack based on the role provided.
    Thanks!

    After some more seraching and playing around, I found a pretty useful example out there on the Flex Cookbook beta site.
    The post by stinasius is located at http://www.adobe.com/cfusion/communityengine/index.cfm?event=showDetails&postId=12346&prod uctId=2&loc=en_US

  • How to create  a  login screen

    i need to create a login screen ,only if user enter valid
    username & password it should move to next canvas.
    could any one help me out

    there are many ways.
    if you want the users to be backend users i.e. schema users u candesign a fform with on logon triggers.
    instaed you can have front end users by storing user aname and password in a table , and check for valid user name and passowrd using a form.

  • How to create sso login for webcenter application

    Hi,
    i have created a webcenter portal application with a login page.i have to create a sso login for that application .
    can anyone suggest me how to do?

    Hi.
    Do you have OAM as SSO?.
    The best way is to create a loginProxy page which proxies the user and password entered to OAM Login process (or the other SSO system).
    This post of JayJay will help you: http://jjzheng.blogspot.com/2013/10/non-programmatic-authentication-using.html
    Regards.

  • How to: create a Login page with data tags

    hi, how could i create a jsp login page using the data tags.. and how to associate it with the other jsp pages that should be displayed in case of the correct insertion of the password .

    http://technet.oracle.com:89/ubb/Forum2/HTML/006025.html

  • How to create php login in flash builder 4 using php data service

    I have seen the tutorials for creating a php login authentication using HTTP service in flex 3 It uses genrating xml and reading it . But i want to know how to do that with the help of php services in FB4 . I'm a newbie so please any kind of help would be appriciated as 'm not able to get any flex developer in nagpur ....

    Connect to PHP in FB4 is used when you have a PHP Class and you want to use that in FB, for example Employee.php and it has a Employee class and various methods in that like create, update, get, delete.
    However, if you have exposed your functionality in PHP as a HTTP URL (i.e. it is not a class), then you should be using HTTPService from the data menu.
    So if your file is login.php and is accessible as a URL, then using the HTTPService and enter the URL.
    Does this help?
    -Sunil

Maybe you are looking for