ch5.persistentData.configure
Class ControllerHelper
java.lang.Object
shared.HelperBaseCh4
shared.HelperBaseCh5
ch5.persistentData.ControllerHelper
ch5.persistentData.configure.ControllerHelper
public class ControllerHelper
- extends ControllerHelper
Extends the persistentData controller, overriding the constructor,
init, doGet and doPost.
Uses the hibernate.cfg.xml file to store the properties for connecting
to hibernate.
The hibernate file should be in the classpath. In NetBeans, add it to
the default package in Source Packages.
|
Constructor Summary |
ControllerHelper(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Call the base class constructor to store the request and response. |
|
Method Summary |
protected void |
doGet()
Call the super class doGet |
protected void |
doPost()
Call the super class doPost |
static void |
initHibernate(boolean create)
The properties are in the hibernate.cfg.xml file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControllerHelper
public ControllerHelper(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
- Call the base class constructor to store the request and response.
- Parameters:
request - Request information encapsulated in a Java objectresponse - Response information encapsulated in a Java object
initHibernate
public static void initHibernate(boolean create)
- The properties are in the hibernate.cfg.xml file. Conditionally create
the table and initialise hibernate.
- Parameters:
create - true means create the table, false means do not create
doGet
protected void doGet()
throws javax.servlet.ServletException,
java.io.IOException
- Call the super class doGet
- Overrides:
doGet in class ControllerHelper
- Throws:
javax.servlet.ServletException
java.io.IOException
doPost
protected void doPost()
throws javax.servlet.ServletException,
java.io.IOException
- Call the super class doPost
- Overrides:
doPost in class ControllerHelper
- Throws:
javax.servlet.ServletException
java.io.IOException