if you use tomcat, attached the security of your project to this. you only must modify server.xml
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.postgresql.Driver"
connectionURL="jdbc: postgresql://10.0.0.1:5432/DB"
connectionName="USER_DB" connectionPassword="PASSWORD_DB"
userTable="TABLE_USERS" userNameCol="FIELD_USER" userCredCol="FIELD_PASSWORD"
userRoleTable="TABLE_ROLLS" roleNameCol="FIELD_ROLL" />
and in the web.xml
<login-config>
<auth-method>FORM</auth-method>
<realm-name>MyFirst Protected Area</realm-name>
<form-login-config>
<form-login-page>/PAGE_LOGIN</form-login-page>
<form-error-page>/PAGIE_LOGIN_ERROR</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>ROLLS_THA_ACEPT_THE_SYSTEM</role-name>
</security-role>
Albert