InfoCenter Home >
5: Securing applications -- special topics >
5.4: Overview: Using programmatic and custom logins >
5.4.3: Form-based login >
5.4.3.2: The CustomLoginServlet class

5.4.3.2: The CustomLoginServlet class

The CustomLoginServlet extracts the user ID, password, and redirect URL information from the HTML form by which the user logged in. The redirect URL specifies the Web site to which the user is requesting access. The CustomLoginServlet invokes the necessary methods on its parent servlet, AbstractLoginServlet.

The following list summarizes the public methods in the CustomLoginServlet class. The source and class files are installed in the directory <installation_root>/servlets/.

init()
This method initializes the servlet, reading the default redirect URL if it exists. The default redirect URL specifies the Web page to which the user will be forwarded if authentication is successful.

Syntax:
void init(ServletConfig conf) throws ServletException
doPost()
The primary entry point into the servlet, this method is designed to be called as the result of an HTML form post. The method reads and validates the posted parameters, then calls the login method in the base class LoginServlet.

Syntax:
void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
postLogin()
This method is called after performing a successful login, so it is a good place to establish an HTTP session or perform other actions related to the logged-on user. This method runs under the identity of the user.

Syntax:
void postLogin(HttpServletRequest req, HttpServletResponse res)
throws ServletException
Go to previous article: AbstractLoginServlet Go to next article: SSOAuthenticator

 

 
Go to previous article: AbstractLoginServlet Go to next article: SSOAuthenticator