Using HTTP POST. Write a Servlet to validate user input and authenticate users.

There is a good example here: login Authentication using Bean and Servlet In JSP

immutable objects