I just started learning java, and ha开发者_如何转开发ve not worked with java ee. I need to authenticate users using servlets. Advise, please, sample code and technical literature. Thank you!
create a html form that accept username / password.
post these data to a servlet.
in doPost() read these data from
request
check them against database.set some parameter in
session
that will show your system that this user is authenticated and logged in.
Also See
- Document
- A Simple step by step example + tutorial
Very simple Servlet/JSP related code to get you started. And here is a fine example of Form Based Authentication Using Servlet.
精彩评论