i want to be able to run my application in 2 modes:
1. production - using LDAP.
2. presentations/development using the UsersRolesLoginModule.
is there a way to know from a servlet/session bean which one is used?
No. Prod should use a different configuration name to map the login module configuration to ldap and dev the properties files. Externalize the name via a servlet init param or just change the definition in the conf/login-config.xml. The servlet should not have to figure out the correct choice.