container-managed

Is it possible to retrieve username, password and roles from a database instead of retrieving them from tomcat-user.xml while using container-managed security

I have a web application which i deploy in Tomcat. I want to secure all pages under the url path administration/*. I have set up container-managed security entering the next snippet in the web.xml file: <security-role> <role-name>administrator</role-name> </security-role> <login-config> <auth-method>BASIC</auth-method> ...

Help me make this code exception-safe.

So I have this library code, see... class Thing { public: class Obj { public: static const int len = 16; explicit Obj(char *str) { strncpy(str_, str, len); } virtual void operator()() = 0; private: char str_[len]; }; explicit Thing(vector<Obj*> &o...

Alternative ways to configure security constraints with container managed security outside web.xml?

Hi, if you use Java EE 6 container managed security, you can configure security constraints for resources inside the web.xml deployment descriptor. Are there alternative ways to do this? For example the container could fetch them out of a database, like it does with the user data. Is something like this possible? I would like a way th...

How do i catch exceptions from container managed transaction commit?

Hi! I have a @Stateless EJB with a @WebService interface, using container managed transactions, meaning transactions are automatically committed by the container after a method has been called if it doesn't throw a system exception. If i try to EntityManager.persist(...) two objects with the same value for a column with a unique const...

Ajax Log-in or Auto-login with J2EE Container-Managed Security (FORM-based auth)

I have a J2EE webapp which uses standard FORM-based authentication, using a login.jsp page, which works okay, apart from a couple of glitches: If username/password are incorrect, the login error page auto-redirects back to login.jsp, but unfortunately "j_security_check" then appears at the end of the URL - which I know is sub-optimal. ...