Recommendations for java captcha libraries [closed]

I am the author of SimpleCaptcha. While I would recommend — for humanity’s sake — using ReCaptcha where you can, I provided SimpleCaptcha because some organizations have policies which prohibit libraries like ReCaptcha. SimpleCaptcha is meant to be entirely stand-alone, with no external dependencies: as long as you are in a J2EE container, you should … Read more

Session TimeOut in web.xml

To set a session-timeout that never expires is not desirable because you would be reliable on the user to push the logout-button every time he’s finished to prevent your server of too much load (depending on the amount of users and the hardware). Additionaly there are some security issues you might run into you would … Read more

Session shared in between tabs

Usually cookies are used for session handling. Then all tabs and browser windows share the same session. But you can configure your servlet container to use URL rewrite instead of cookies. (Here is an example for Jetty.) With URL rewrite the session is only identified via a URL parameter containing the session ID. So every … Read more

Java EE authentication: how to capture login event?

There’s no such event in Java EE. Yet. As part of JSR375, container managed security will be totally reworked as it’s currently scattered across different container implemantations and is not cross-container compatible. This is outlined in this Java EE 8 Security API presentation. There’s already a reference implementation of Security API in progress, Soteria, developed … Read more

How to include values from .properties file into web.xml?

You can add this class, that add all properties from your file to JVM. And add this class like context-listener to web.xml public class InitVariables implements ServletContextListener { @Override public void contextDestroyed(final ServletContextEvent event) { } @Override public void contextInitialized(final ServletContextEvent event) { final String props = “/file.properties”; final Properties propsFromFile = new Properties(); try … Read more

Java web service without a web application server

You don’t need a third party library to use jax-ws annotations. J2SE ships with jax-ws, so all the annotations are still available to you. You can achieve lightweight results with the following solution, but for anything optimized/multi-threaded, it’s on your own head to implement: Design a SEI, service endpoint interface, which is basically a java … Read more