Results 1 to 6 of 6

Thread: login.jsp

  1. #1
    roo7 is offline Member
    Join Date
    Nov 2007
    Posts
    6
    Rep Power
    0

    Default login.jsp

    Hi every body,

    I have question in the login.jsp

    How I can write code for checking the admin and the normal user when he/she login to the website?

    I want the code for checking the admin and the normal user in the same time if the person as admin then forword him to the admin page if the person as normal user then forword it to the user page.


    please could you help me.....

    thanks.
    :o

  2. #2
    naresh_m is offline Member
    Join Date
    May 2008
    Posts
    5
    Rep Power
    0

    Default

    hi
    After login any user first u check the user type role in action class i.e Maintain menus and their links .. like menuname, link,role type example HOME : admin_home.jsp : admin :null
    HOME general_home.jsp : null :user

    ok

  3. #3
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    6

    Default

    hello,

    Another approach is you can add another column in your database table. I think you have Username and password in your table. You can another column in your table named "Access_Rigth". Where in you can fill it with eithe "ADMIN" or "NORMAL". Just retrieves this fields so can compare it later in your Servlet or script. Then point the Next Page to the AdminMain.jsp for Admin or Main.jsp for Normal User. I hope that helps
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  5. #5
    linuxswan is offline Member
    Join Date
    Mar 2008
    Posts
    28
    Rep Power
    0

    Default

    Quote Originally Posted by Eku View Post
    hello,

    Another approach is you can add another column in your database table. I think you have Username and password in your table. You can another column in your table named "Access_Rigth". Where in you can fill it with eithe "ADMIN" or "NORMAL". Just retrieves this fields so can compare it later in your Servlet or script. Then point the Next Page to the AdminMain.jsp for Admin or Main.jsp for Normal User. I hope that helps
    I go with him, because you can choose the moderator or give some more specific rights to particular user. So creating another column is usefull which will differentiate who is normal user and who admin. Some times simple name other than "admin" or "administrator" is used for admin. ok

  6. #6
    angelicsign is offline Member
    Join Date
    Dec 2008
    Posts
    25
    Rep Power
    0

    Default

    ya,my case.
    normally i use user as 1,admin as 2.
    so make 1 more column on db.
    username,password,category.
    at the login.jsp
    with a list box,ask user to choose either he is user or admin
    Java Code:
    Username: <input type="text" name="username" maxlength="45">
    Password: <input type="password" name="pwd" maxlength="16"><select id="userType" name="category">
    <option value="1" selected="selected">User</option>
    <option value="2">Administrator</option>
    this is a code segment of html.

Similar Threads

  1. Login Forms
    By dankonsoer in forum New To Java
    Replies: 1
    Last Post: 08-07-2008, 12:06 PM
  2. Login with mysql
    By fernando in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 03:30 PM
  3. I want to get values from login jsp
    By trill in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 07:33 AM
  4. problems with Login
    By Peter in forum Java Servlet
    Replies: 2
    Last Post: 06-12-2007, 01:50 PM

Posting Permissions

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