Configure the Liberty profile for Servlet 3.1
We can configure the Liberty profile for the Servlet 3.1 feature, which provides full support for the Servlet 3.1 specification.
To configure a Liberty server to run an application enabled for Servlet 3.1, set the <servlet-3.1> feature.
Update server.xml to add the <servlet-3.1> feature. For example:
<featureManager> <feature>servlet-3.1</feature> </featureManager>Important:
- The websocket-1.0 feature requires the servlet-3.1 feature and as a result, configuring the websocket-1.0 feature causes the servlet-3.1 feature to load.
- We can use other Java EE 6 features, such as jsp-2.2 and jsf-2.0, with the servlet-3.1 feature. We cannot use a Java EE 6 feature to exploit Servlet 3.1 features.
- We can choose between the Servlet 3.0 and Servlet 3.1 feature implementations for each server instance, but we must consider any behavior changes. If required behavior is contained only in the Servlet 3.1 feature, then use the Servlet 3.1 feature. If an existing application would be adversely impacted by behavior changes in the Servlet 3.1 feature, then use the Servlet 3.0 feature to preserve 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.
Results
The Servlet-3.1 feature now loads at run time.
Parent topic: Administer web applicationsReference:
JSR-000340 Java Servlet 3.1 Specification