Wrapping POJO Classes with Mashups
You can use any Java class accessible to the Presto Server within the mashup <script> statement using JavaScript. Because of this feature, you can easily use POJO classes as Presto mashables by wrapping them in mashup scripts.
Note: | Based on the JDK version used with the application server that hosts the Presto Server, Java language classes are also available within mashup <script> statements. |
To wrap POJO classes in mashup scripts
1. Include the POJO classes in the Presto Server classpath by copying the compiled class file or JAR file to one of these folders:
Important: | Deploying additional resources, such as custom XPath classes, to an external configuration folder simplifies future deployments or Presto Server clusters. |
web-apps-home/presto/WEB-INF/classes. This is the default location, but is not recommended as it complicates
Presto Server deployments.
web-apps-home/presto/WEB-INF/lib. This is the default location, but is not recommended as it complicates
Presto Server deployments.
2. Create a separate wrapper mashup script for each POJO method that you want to expose as a Presto mashable information source.
3. In the wrapper mashup script:
Add <input> declarations, if needed, to accept input parameters for the Java method and an <output> declaration to receive the method return, if any.