Configuring Liberty for Servlet 3.1

You can configure Liberty for the Servlet 3.1 feature, which provides full support for the Servlet 3.1 specification.

About this task

To configure a Liberty server to run an application that is enabled for Servlet 3.1, you must set the <servlet-3.1> feature.


Update the server.xml file to add the <servlet-3.1> feature.
For example:
  • The websocket-1.0 and websocket-1.1 features require the servlet-3.1 feature, and as a result, configuring the websocket-1.0 or websocket-1.1 feature causes the servlet-3.1 feature to load.
  • You can use Java™ EE 6 features, such as jsp-2.2 and jsf-2.0, with the servlet-3.1 feature. However, you cannot use a Java EE 6 feature to exploit Servlet 3.1 features.
  • You can choose between the Servlet 3.0 and Servlet 3.1 feature implementations for each server instance, but you must consider any behavior changes. If required behavior is contained only in the Servlet 3.1 feature, then you must use the Servlet 3.1 feature. If an existing application would be adversely affected by behavior changes in the Servlet 3.1 feature, then using the Servlet 3.0 feature preserves the existing behavior for that application.
  • It is not possible to use both the Servlet 3.0 and Servlet 3.1 features in the same server. If both features are configured, it will produce an error. Read the Servlet 3.1 behavior changes topic to learn about changes from Servlet 3.0 and Servlet 3.1.


The Servlet-3.1 feature now loads at run time.