Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Login page using sql database in servlets  RSS feed

 
Irfan Zubair
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to create a login page. the website contains three types of user: Students, faculty and admin. Based on their role the appropriate home page has to be shown. Anyone help me for doing this.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66256
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's your code? What problem are you having with it?
 
Irfan Zubair
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want some idea to implement.
 
sneha ulhe
Ranch Hand
Posts: 52
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can retreive role on the basis of username provided by user and then check it with if..else and then forward the request to respective pages using request dispatcher..try this..
 
Palak Mathur
Ranch Hand
Posts: 343
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Irfan Zubair wrote:Hi,
I want to create a login page. the website contains three types of user: Students, faculty and admin. Based on their role the appropriate home page has to be shown. Anyone help me for doing this.


We are not here to do your homework but surely to help you do it. You have to decide what and how you will do it. And if you face any issues and want some help with that decision (after that decision has been taken) come to us.

Edit: After Bear's comment!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66256
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Palak Mathur wrote:We are not here to help you do your homework.

Actually, what I believe Palak Mathur really meant was: we are here to help you do your homework, but not to do it for you.
 
Palak Mathur
Ranch Hand
Posts: 343
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Palak Mathur wrote:We are not here to help you do your homework.

Actually, what I believe Palak Mathur really meant was: we are here to help you do your homework, but not to do it for you.


Yes!! I wanted to say that!!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66256
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JDBC Realm.
 
Irfan Zubair
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not asking to do it for me. I just want some better ideas to do it.
 
Palak Mathur
Ranch Hand
Posts: 343
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Irfan Zubair wrote:I am not asking to do it for me. I just want some better ideas to do it.

Hi Irfan,

If you will tell us what is in your mind then we can tell you if we have a better idea.
 
Irfan Zubair
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Palak Mathur,
Thanks for your support. I'll post the code after completing it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!