Class ViewData

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--ViewData
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ViewData
extends javax.servlet.http.HttpServlet

Handles the login verification, errors thrown during verification, and prints the frames for the application or an message informing the user why the login failed. Upon a successful login, a session is created that stores the users name.

See Also:
Serialized Form

Constructor Summary
ViewData()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles requests using the 'get' method by passing to the 'post' method handler.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles requests using the 'post' method.
 void init(javax.servlet.ServletConfig config)
          Initialize the Servlet
 void printMessage(java.io.PrintWriter out, java.lang.String type)
          Generates the HTML to display a message indicating why the login failed
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewData

public ViewData()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialize the Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - the configuration parameters
Throws:
javax.servlet.ServletException - a Servlet error occurred

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Handles requests using the 'get' method by passing to the 'post' method handler.
Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - the HttpRequest
response - the HttpResponse
Throws:
java.io.IOException - an I/O error occurred
javax.servlet.ServletException - a Servlet error occurred

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Handles requests using the 'post' method. Verifies the login parameters using a SQLRequest object and either displays the HTML frames for the application or a message explaining why the login failed
Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - the HttpRequest
response - the HttpResponse
Throws:
java.io.IOException - an I/O error occurred
javax.servlet.ServletException - a Servlet error occurred

printMessage

public void printMessage(java.io.PrintWriter out,
                         java.lang.String type)
Generates the HTML to display a message indicating why the login failed
Parameters:
out - the PrintWriter to display the output
type - the message type