Following
WEB-INF/web.xml
descriptor will enable JEST to
operate on a persistence unit named
${persistence.unit}
. Of course, JEST
servlet must be in the same module scope of the application that is using using
${persistence.unit}
as its persistence unit.
<servlet>
<servlet-name>
${servlet.name}</servlet-name>
<servlet-class>
org.apache.openjpa.persistence.jest.JESTServlet</servlet-class>
<init-param>
<param-name>
persistence.unit</param-name>
<param-value>
${persistence.unit}</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>
${servlet.name}</servlet-name>
<url-pattern>
/${servlet.name}/*</url-pattern>
</servlet-mapping>
When an web application module named
${webapp.name}
containing the above JEST servlet
in a servlet container runs on
${server.name}
at port ${server.port}, then the JEST servlet
can be accessed at
http://${server.name}:${server.port}/${webapp.name}/${servlet.name}/
(
do not miss the the trailing forward-slash / character)