|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet ch6.complexPersistent.Controller
public class Controller
Saves the bean to a database. The bean will use Hibernate annotations to simplify saving data to a database. Hibernate will be initialised in the init method of the controller. The bean uses complex form elements, which will need additional annotations to be saved to the database.
Constructor Summary | |
---|---|
Controller()
|
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. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
When the browser makes a POST request, this is the method in the controller that is called. |
void |
init()
This method is called once, when the servlet is loaded into memory. |
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, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Controller()
Method Detail |
---|
public void init()
init
in class javax.servlet.GenericServlet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
The work of the controller will be handled by the helper. The controller will create the helper class and call its doGet method to process the request.
doGet
in class javax.servlet.http.HttpServlet
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.
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.protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
The work of the controller will be handled by the helper. The controller will create the helper class and call its doPost method to process the request.
doPost
in class javax.servlet.http.HttpServlet
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.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |