ch3.defaultValidate
Class Controller
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
ch3.defaultValidate.Controller
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class Controller
- extends javax.servlet.http.HttpServlet
The controller is the servlet that encapulates
the logic of the application.
This example uses a bean that implements default
validation. The controller is identical to the
controller from the dataBean controller. All the
work for implementing default validation is encapsulated
in the bean.
- See Also:
- Serialized Form
Method Summary |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
When the browser makes a GET request, this is
the method in the controller that is called. |
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 |
Controller
public Controller()
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- When the browser makes a GET request, this is
the method in the controller that is called.
A bean is used to encapsulate the data from the application.
- The bean must be added to the session, so that JSPs can
retrieve it.
- The data in the query string must be copied from the request
into the bean.
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Parameters:
request
- Encapsulates all of the request information that is
needed to communicate with the browser.response
- Encapsulates all of the response information that is
needed to communicate with the browser.
- Throws:
javax.servlet.ServletException
- A servlet exception is a severe error
that will prevent further processing.
java.io.IOException
- An IO exception is a severe error
that will prevent further processing.