no.feide.moria.servlet
Class LoginServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by no.feide.moria.servlet.MoriaServlet
              extended by no.feide.moria.servlet.LoginServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class LoginServlet
extends MoriaServlet

Use this servlet to bootstrap the system. Set <load-on-startup>1</load-on-startup> in web.xml.

Version:
$Revision: 1.51 $
Author:
Lars Preben S. Arnesen <lars.preben.arnesen@conduct.no>
See Also:
Serialized Form

Field Summary
private  no.feide.moria.log.MessageLogger log
          Used for logging.
private static java.lang.String[] REQUIRED_PARAMETERS
          List of parameters required by LoginServlet.
 
Constructor Summary
LoginServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles the GET request.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles the POST request.
private  java.util.Properties getConfig()
          Gets the current configuration from the context.
static java.lang.String[] getRequiredParameters()
           
private  void showLoginPage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String errorType)
          Displays the login page.
 
Methods inherited from class no.feide.moria.servlet.MoriaServlet
getServletConfig
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final no.feide.moria.log.MessageLogger log
Used for logging.


REQUIRED_PARAMETERS

private static final java.lang.String[] REQUIRED_PARAMETERS
List of parameters required by LoginServlet.

Current required parameters are:

See Also:
RequestUtil.PROP_COOKIE_SSO, RequestUtil.PROP_COOKIE_SSO_TTL, RequestUtil.PROP_COOKIE_DENYSSO, RequestUtil.PROP_COOKIE_DENYSSO_TTL, RequestUtil.PROP_COOKIE_LANG, RequestUtil.PROP_COOKIE_LANG_TTL, RequestUtil.PROP_COOKIE_ORG, RequestUtil.PROP_COOKIE_ORG_TTL, RequestUtil.PROP_LOGIN_TICKET_PARAM, RequestUtil.PROP_LOGIN_DEFAULT_LANGUAGE, RequestUtil.PROP_LOGIN_URL_PREFIX, RequestUtil.PROP_FAQ_STATUS
Constructor Detail

LoginServlet

public LoginServlet()
Method Detail

getRequiredParameters

public static java.lang.String[] getRequiredParameters()
Returns:
The required parameters for this servlet.

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Handles the GET request. The GET request should contain a login ticket as parameter. An SSO ticket can also be presented by the user's web browser (in form of a cookie). The method will try to perform an SSO authentication if the conditions for this is met, else it will present the login page to the user.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP request object.
response - The HTTP response object.
Throws:
java.io.IOException - Required by interface.
javax.servlet.ServletException - Required by interface.

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Handles the POST request. The POST request indicates that the user is trying to authenticate. If the authentication is successful, the user is redirected back to the originating web service, else the user is presented with an error message.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP request.
response - The HTTP response.
Throws:
java.io.IOException - Required by interface.
javax.servlet.ServletException - Required by interface.

showLoginPage

private void showLoginPage(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           java.lang.String errorType)
                    throws java.io.IOException,
                           javax.servlet.ServletException
Displays the login page. The method fills the request object with values and then passes the request to the JSP.

Parameters:
request - The HTTP request.
response - The HTTP response.
errorType - The type of the error set by the caller.
Throws:
java.io.IOException - When the JSP throws this exception.
javax.servlet.ServletException - When the JSP throws this exception.

getConfig

private java.util.Properties getConfig()
Gets the current configuration from the context. The configuration is expected to be set by the controller before requests are sent to this servlet.

Returns:
The current configuration, as read from the servlet context.
Throws:
java.lang.IllegalStateException - If the configuration has not been set, or if any required configuration parameters are missing.
See Also:
REQUIRED_PARAMETERS


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.