Instead of implementing something on your own, try using an existing and proven solution like spring security, adding a simple user login form and remember me functionality is a matter of configuration in your context XML, Try this tutorial.
If you need an alternative then you could also use Apache Shiro.