Liberty Profile + Servlet 2.4

时间:2014-09-03 21:26:05

标签: java servlets classloader websphere-liberty

嗨,我希望你可以帮助我:),我有一个使用servlet 2.4的网络应用程序,我知道很老但我试图在Liberty Profile 8.5.5.3上部署这个应用程序,Liberty Profile使用“功能” “我正在使用”jsp-2.2“,我读到了该功能并使用了Servlet 3.0,假设我可以使用其他servlet版本,如果我使用classLoader配置但是当我启动我的Server Liberty Profile Web时,它使用Servlet 3.0,可以使用Liberty Profile和Servlet 2.4吗?

我的server.xml配置是:

<?xml version="1.0" encoding="UTF-8"?>
<server description="server01">

<!-- Enable features -->
 <featureManager>
   <feature>jsp-2.2</feature>
 </featureManager>
 <application id="webapptest" name="webapp type="ear" location="D:/LBP/webapp.ear">
   <classloader delegation="parentLast" commonLibraryRef="mySharedLib"></classloader>
 </application>
 <library id="mySharedLib">
    <fileset dir="D:/LBP/wlp/usr/servers/server-prueba01/myLib" includes="*.jar" />
 </library>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
 <httpEndpoint id="defaultHttpEndpoint"
              httpPort="9088"
              httpsPort="9443" />
 </server>

在“commonLibraryRef”中我放了“servlet-api-2.4”jar

1 个答案:

答案 0 :(得分:0)

我建议你只是将应用程序和Web部署描述符更新到Java EE 6(Servlet 3.0):

// web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">

// application.xml
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">

并尝试使用您的应用程序。我会说大多数2.4 servlet在3.0中运行良好。

如果您尝试从其他应用服务器迁移,可以尝试IBM WebSphere Application Server Migration Toolkit查看迁移应用程序需要进行多少更改。

相关问题