How can I protect my JSP resources using security realms under Tomcat 4?

Govind Seshadri

Tomcat provides you with Realms, which is mechanism for defining a collection of usernames, passwords, and their associated roles. It gives you the ability to protect a resource with a defined security constraint and then define the user roles that can access the protected resource. There are two Realm implementations provided in Tomcat 4 - Memory and JDBC Realms. For a good introduction to both, read the onjava.com article Using Tomcat 4 Security Realms.