ch3.dataBean
Class Controller

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by ch3.dataBean.Controller
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Controller
extends javax.servlet.http.HttpServlet

The third basic function of a controller is to process the user data. The best way to process data is to create a separate class that encapsulates the data and all the operations on the data. This controller uses a bean to store all the data that is sent in the request.

See Also:
Serialized Form

Constructor Summary
Controller()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This is the HttpServlet method that handles GET requests.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, 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
 

Constructor Detail

Controller

public Controller()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
This is the HttpServlet method that handles GET requests. It will create a bean, translate a button name into an address and forward the request to that address. The data is placed into the session so that the JSP will have access to it.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - Request information encapsulated in a Java object
response - Response information encapsulated in a Java object
Throws:
javax.servlet.ServletException
java.io.IOException