ch7.catalog
Class CreateCatalog

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by ch7.catalog.CreateCatalog
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CreateCatalog
extends javax.servlet.http.HttpServlet

See Also:
Serialized Form

Constructor Summary
CreateCatalog()
           
 
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.
 void init()
          Most of the details for initialising Hibernate are in the hibernate.cfg.xml file.
 
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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateCatalog

public CreateCatalog()
Method Detail

init

public void init()
Most of the details for initialising Hibernate are in the hibernate.cfg.xml file. The only details left for this method are to create the table of catalog items and create the session factory.

Overrides:
init in class javax.servlet.GenericServlet

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.

This application does not have any JSPs. All it needs to do is add the items to the database and write a confirmation message to the browser.

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.