Jun 29

Generally investing JVM states is easier since Oracle provide the tools inside the JDK (jstack, jstat, jconsole,…) but what to do when a process hangs for no reason?
Continue reading “Investigate process state and memory in Linux” »

Apr 7

MQTT Service with MQTTCallback innerclass to handle messages
Continue reading “Android MQTT service – Code example” »

May 13

J2EE offer different ways to check user authentication and authorization (JAAS, Apache SHIRO, Servlet Filters), often for demo software (or small ones) what you really need is a simple Session Bean as EventListener.

This ipotetic Session Bean manages user redirections between JSF views; consider this example with two views:

If a Guest user goes to http://localhost:8080/demo/business.xhtml he is gets redirected to loginform.xhtml, the Listener method save the originating URI (business.xhtml) and, if the auhentication is successful, brings the user back to the business view.

Setting the Event in view permit us to deny the access calling SessionBean.verifyUserLogin():

<f:event type="preRenderView" listener="#{SessionBean.verifyUserLogin()}"></f:event>

Continue reading “Simple authentication with java bean” »