Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-26-2008, 07:31 PM
Member
 
Join Date: Nov 2007
Posts: 6
roo7 is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-30-2008, 09:02 AM
Member
 
Join Date: May 2008
Posts: 5
naresh_m is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-30-2008, 09:43 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-30-2008, 09:58 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,047
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
For me also the best solution is dealing with DB. User name is the key here, as Eku said.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on September 4, 2008)

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-15-2008, 07:03 PM
Member
 
Join Date: Mar 2008
Posts: 27
linuxswan is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Forms dankonsoer New To Java 1 08-07-2008 01:06 PM
JSP - Login Page Example JavaForums Java Blogs 2 08-13-2007 10:21 AM
Login with mysql fernando JavaServer Pages (JSP) and JSTL 1 08-07-2007 04:30 PM
I want to get values from login jsp trill JavaServer Pages (JSP) and JSTL 1 08-07-2007 08:33 AM
problems with Login Peter Java Servlet 2 06-12-2007 02:50 PM


All times are GMT +3. The time now is 08:44 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org