The enforceLogin tag 

Overview 

This tag is used to check that the person accessing the page has been logged in. It checks that the client is presenting a valid Jeenius session cookie and binds the user ID to the current Session object  

Tag Usage 

This tag has the following usage: <jee:enforceLogin redirectUrl=”url to redirect if not logged in”/>· redirectUrl – This is the URL to which the user is redirected if they have not logged in.This tag extracts the token from the Jeenius session cookie and validates it with the security provider. If it is valid it binds the user ID (see Constants & JavaBeans section) into the current Session object and allows the rest of the page to be executed. If the token is not valid it redirects the user to the redirectUrl. 

Example 

The following code shows an example of using this tag:

<%@ taglib uri="jeenius" prefix="jee" %>
<jee:enforceLogin redirectUrl="not_logged_in.jsp"/>
<html>
 <body>
  <h2>Login Test</h2>
  <p>You are logged in !</p>
 </body>
</html>