Publishing Engine Programmer's Guide > The Arbortext Publishing Engine Sub-Process > Writing Arbortext PE Applications in Java > Creating a Java Arbortext PE Application
  
Creating a Java Arbortext PE Application
Your Java Arbortext PE Application must implement the com.arbortext.e3.E3Application interface, which is modeled on the Java Servlet 2.3 specification.
The Arbortext Publishing Engine interface is located in the install tree at PE_HOME\lib\classes\pecommon.jar. This JAR file contains the following interface definitions:
com.arbortext.e3.E3Application
com.arbortext.e3.E3ApplicationConfig
Passed to the init method.
com.arbortext.e3.E3ApplicationRequest
Passed to doGet and doPost methods
com.arbortext.e3.E3ApplicationResponse
Passed to the doGet and doPost methods
All Javadoc for the Arbortext Editor and Arbortext Publishing Engine interfaces is available in the Programming > Javadoc > Arbortext Publishing Engine section of Help Center.
A Java Arbortext PE Application must define the methods init, doGet, doPost, and destroy. The doGet and doPost methods take the request object E3ApplicationRequest and response object E3ApplicationResponse as parameters. The request and response objects are passed by the Arbortext PE Request Manager to an Arbortext PE sub-process for processing. The Arbortext PE sub-process passes the request and response objects to the Arbortext PE Application.
The E3ApplicationConfig interface provides configuration information from the Arbortext Publishing Enginee3config.xml file. Use this interface to retrieve the configuration parameters and their values. The configuration information is passed to the init method (explained in later in this section), which should retain it for possible subsequent use by doGet or doPost methods.
In Arbortext Publishing Engine, exceptions are handled in the following ways:
Errors in E3ApplicationRequest and E3ApplicationResponse methods called by user code will be handled as exceptions. Any exceptions not handled by the user's code will be caught by Arbortext Publishing Engine.
Arbortext Publishing Engine also catches any unhandled exceptions thrown by user-written Arbortext PE Application methods.
For any exceptions not caught by the custom application, an HTML page is returned to the client describing the error in as much detail as possible.
* 
The f=java function can specify a custom application that returns a file of any type. It can also set the HTTP status code, reason phrase, and headers to any requested value.