Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.persistence.jest
Class JESTServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.apache.openjpa.persistence.jest.JESTServlet

All Implemented Interfaces:
  Serializable, Servlet, ServletConfig

    public class JESTServlet

extends 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:
  Serialized Form

Field Summary
`protected static Localizer` | `_loc`
`static String` | `INIT_PARA_STANDALONE`
`static String` | `INIT_PARA_UNIT` Servlet initialization parameter monikers

Constructor Summary
`JESTServlet()`

Method Summary
`protected void` | `createPersistenceUnit()`
`void` | `destroy()`
`void` | `doGet(HttpServletRequest request, HttpServletResponse response)` Peeks into the servlet path of the request to create appropriate `JEST command`.
`protected boolean` | `findPersistenceUnit()`
`protected void` | `handleError(JPAServletContext ctx, Throwable t)`
`void` | `init(ServletConfig config)`
`void` | `log(String s)`

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INIT_PARA_UNIT

    public static final String INIT_PARA_UNIT

  Servlet initialization parameter monikers

  See Also:
    Constant Field Values

### INIT_PARA_STANDALONE

    public static final String INIT_PARA_STANDALONE

See Also:
  Constant Field Values

### _loc

    protected static Localizer _loc

Constructor Detail

### JESTServlet

    public JESTServlet()

Method Detail

### init

    public void init(ServletConfig config)
              throws ServletException

  Specified by:
    `init` in interface `Servlet`
  Overrides:
    `init` in class `GenericServlet`
  Throws:
    `ServletException`

### doGet

    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
               throws ServletException,
                      IOException

  Peeks into the servlet path of the request to create appropriate `JEST command`. Passes the request on to the command which is responsible for generating a response.

  Overrides:
    `doGet` in class `HttpServlet`
  Throws:
    `ServletException`
    `IOException`

### createPersistenceUnit

    protected void createPersistenceUnit()
                                  throws ServletException

  Throws:
    `ServletException`

### findPersistenceUnit

    protected boolean findPersistenceUnit()

### handleError

    protected void handleError(JPAServletContext ctx,
                               Throwable t)
                        throws IOException

  Throws:
    `IOException`

### destroy

    public void destroy()

  Specified by:
    `destroy` in interface `Servlet`
  Overrides:
    `destroy` in class `GenericServlet`

### log

    public void log(String s)

  Overrides:
    `log` in class `GenericServlet`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.