O'Reilly logo

GateIn Cookbook by Piergiorgio Lucidi, Luca Stancapiano, Ken Finnigan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a login page

In this recipe, we will configure a login page for a new portal.

Getting ready

To complete this task, we need to have some knowledge of the following technologies:

  • Servlets/JSPs
  • JAAS
  • GateIn, as many Java products use JAAS for authentication management, JSPs for the login forms, and servlets for operations such as login, logout, remind me, change password, and so on.

How to do it…

  1. In the web.xml of the main GateIn web application, add the code:
    <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>gatein-domain</realm-name>
      <form-login-config>
        <form-login-page>/initiatelogin</form-login-page>
        <form-error-page>/errorlogin</form-error-page>
      </form-login-config>
    </login-config>
  2. Add a JSP inside the portal root with this path:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required