Saska
Saska

Reputation: 1021

java ee - authenticate users using servlets

I just started learning java, and have not worked with java ee. I need to authenticate users using servlets. Advise, please, sample code and technical literature. Thank you!

Upvotes: 2

Views: 2502

Answers (2)

Jigar Joshi
Jigar Joshi

Reputation: 240948

  1. create a html form that accept username / password.

  2. post these data to a servlet.

  3. in doPost() read these data from request check them against database.

  4. set some parameter in session that will show your system that this user is authenticated and logged in.

Also See

Upvotes: 3

Adeel Ansari
Adeel Ansari

Reputation: 39907

Very simple Servlet/JSP related code to get you started. And here is a fine example of Form Based Authentication Using Servlet.

Upvotes: 3

Related Questions