Do some initialization work after the web application initialization process

We can achieve this by using a webListener. See code below:package com.czetsuya;import java.text.MessageFormat;import java.util.ResourceBundle;import javax.inject.Inject;import javax.servlet.ServletContextEvent;import javax.servlet.ServletContextListener;import javax.servlet.annotation.WebListener;import...

How to protect your page using WebFilter in JavaEE

This tutorial is to be use in conjunction with picketlink. Normally we want some pages to be accessible only after a user has logged in. In this case we need a real protection filter.The class below filters a url path and check if there's a logged in user.package com.czetsuya.listener;import java.io.IOException;import...