Advanced

Advanced topics

Servlets

In the layout, servlets can be used to generate the content for the different user interface components such as pages, blocks, and dialogs.

These servlets can be used by:

  • The Layout manager to generate the user interface, or more precisely, to generate part of the content of a UI component.
  • An external API which may be invoked by another application or Ant Tasks in the Publish Engine.

Deprecation warning!

The Servlets are gradually being deprecated, instead the recommended mechanism to access PageSeeder's functionality is to use Services.

Usage

PageSeeder servlets can be invoked on the Web as:

/ps/servlet/{servlet}

Where servlet is the full class name of the Servlet.

See the documentation for each Servlet to know which parameter can or should be specified, the HTTP method and other permission requirements.

Layout

Servlets can be referenced in the layout configuration file using the <servlet> element. The @class attribute must be specified and refer to a existing servlet.

See example for a fictional page:

<!-- A sample servlet used for a page -->
<page id="group-acme-test" scope="group" title="Test">
 <url pattern="/acme/test"/>
  <servlet class="com.pageseeder.DoSomething">
    <parameter name="uri"     value="{@uri.id}"/>
    <parameter name="xformat" value="xml"/>
  </servlet>
</page>

Note

To ensure that the servlet will return XML, generally include the xformat parameter. Check the API documentation for the servlet intended to be used.

Support

Some Servlets have been designed for the layout and should not be used as an API (it may be because their API is not stable or because they rely on a specific state of the system). Other Servlets are more API friendly.

Each Servlet documentation will show clearly in which context it is supported and the level of support.

LevelDescription
Not SupportedThe Servlet MUST NOT BE USED and will probably fail.
ExperimentalThe Servlet may work, but has not been tested, or its API may change in future releases, PageSeeder SHOULD NOT BE USED.
SupportedThe Servlet has a stable API and has been successfully tested in this context, so go ahead!
DeprecatedThe Servlet has reached its end of life, it has been scheduled to be removed from the API in subsequent releases of PageSeeder and marked as obsolete. PageSeeder will generally provide a replacement.
ObsoleteThe Servlet is no longer functional and MUST NOT BE USED.

Created on , last edited on