Class JESTServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.openjpa.persistence.jest.JESTServlet
- All Implemented Interfaces:
 Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class JESTServlet
extends javax.servlet.http.HttpServlet
A specialized HTTP servlet to interpret HTTP requests as Java Persistent API commands
 on a running persistence unit. The persistence unit is identified by the name of the
 unit and is supplied to this servlet during its initialization. The component using
 the persistent unit and this servlet must be within the same module scope.
 
 
 
The syntax of the request URL is described in OpenJPA web site.
 The response to a resource request is represented in various format, namely
 XML, JSON or a JavaScript that will dynamically render in the browser. The format
 can be controlled via the initialization parameter response.format in
 <init-param> clause or per request basis via format=xml|dojo|json
 encoded in the path expression of the Request URI.
 
Servlet initialization parameter
| Parameter | Value | 
|---|---|
| persistence.unit | Name of the persistence unit. Mandatory | 
| response.format | Default format used for representation. Defaults to xml. | 
- Author:
 - Pinaki Poddar
 - See Also:
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoiddestroy()voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Peeks into the servlet path of the request to create appropriateJEST command.protected booleanprotected voidhandleError(JPAServletContext ctx, Throwable t) voidinit(javax.servlet.ServletConfig config) voidMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceMethods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log 
- 
Field Details
- 
INIT_PARA_UNIT
Servlet initialization parameter monikers- See Also:
 
 - 
INIT_PARA_STANDALONE
- See Also:
 
 - 
_loc
 
 - 
 - 
Constructor Details
- 
JESTServlet
public JESTServlet() 
 - 
 - 
Method Details
- 
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException - Specified by:
 initin interfacejavax.servlet.Servlet- Overrides:
 initin classjavax.servlet.GenericServlet- Throws:
 javax.servlet.ServletException
 - 
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Peeks into the servlet path of the request to create appropriateJEST command. Passes the request on to the command which is responsible for generating a response.- Overrides:
 doGetin classjavax.servlet.http.HttpServlet- Throws:
 javax.servlet.ServletExceptionIOException
 - 
createPersistenceUnit
protected void createPersistenceUnit() throws javax.servlet.ServletException- Throws:
 javax.servlet.ServletException
 - 
findPersistenceUnit
protected boolean findPersistenceUnit() - 
handleError
- Throws:
 IOException
 - 
destroy
public void destroy()- Specified by:
 destroyin interfacejavax.servlet.Servlet- Overrides:
 destroyin classjavax.servlet.GenericServlet
 - 
log
- Overrides:
 login classjavax.servlet.GenericServlet
 
 -