从 WebSphere Application Server V5.x 迁移 Web 应用程序组件
不必迁移在 WebSphere® Application Server 先前版本中部署的 Web 应用程序。仍支持 Java™ Servlet 规范 V2.2 和更高版本以及 JavaServer Pages (JSP) 规范 V1.2 和 V1.4,除非在 Servlet 3.1 或 JSP 2.3 规范中更改了此行为。这些更改通常在其相应规范中作了更详细的描述。
关于此任务
在以下实例中,可能会考虑 Servlet 迁移:
- 实现 WebSphere Application Server 内部 Servlet 以绕过 WebSphere Application Server V4.x 单个应用程序路径限制
- 扩展依赖 Servlet 配置 XML 文件中配置信息的 PageListServlet
- 使用 encodeRedirectURL 功能或在非上下文根中启动来调用 Servlet 的 response.sendRedirect 方法
- 取决于要设置的缺省 Content-Type 响应头或者对 getWriter 进行调用后 setContentType 调用的行为。WebSphere Application Server 版本级别 V4、V5、V6 或 V7 使用 Web 容器定制属性 com.ibm.ws.webcontainer.contenttypecompatibility 来设置此行为。每一个版本的行为在“表 1”中进行了描述。
表 1. Web 容器定制属性。. 描述每一个版本的版本行为。 V4 V5 V6 V7 缺省 Content-Type text/html text/html; charset=<default_encoding> 无 无 如果 Content-Type 上不存在属性,那么将 Charset 追加到 getWriter 示例:response.setCharacterEncoding("UTF-8"); response.setContentType("text/xml"); response.getWriter();
text/html text/html text/xml; charset=UTF-8 text/xml; charset=UTF-8 如果在 getWriter 后使用“;charset=”部分调用了 setContentType 属性,那么从 Content-Type 属性中除去 charset 示例:setContentType("text/html;charset=ISO-8859-7"); getWriter(); setContentType("text/xml;charset=UTF-8");
text/html text/html text/html text/xml; charset=ISO-8859-7
如果应用程序引用了未命名包中的 JSP 页面实现类,或在 V5.x 中安装了 WebSphere Application Server V4.x EAR 文件(在 V4.x 中使用 JSP Precompile 选项部署),那么可能需要考虑 JSP 迁移。从 WebSphere Application Server V5.x 进行迁移时,需要重新编译所有 JSP 页面。
如果应用程序引用了未命名包中的 JSP 页面实现类,或在 V5.x 中安装了 WebSphere Application Server V4.0.1 EAR 文件(在 V4.0.1 中使用 JSP Precompile 选项部署),那么可能需要考虑 JSP 迁移。从 WebSphere Application Server V5.x 进行迁移时,需要重新编译所有 JSP 页面。

然而,Java EE 5 或更高版本的模块可以在包含 Java EE 5 之前的文件并使用 .xmi 文件扩展名的应用程序中存在。
ibm-webservices-ext.xmi、ibm-webservices-bnd.xmi、ibm-webservicesclient-bnd.xmi、ibm-webservicesclient-ext.xmi 和 ibm-portlet-ext.xmi 文件继续使用 .xmi 文件扩展名。
sptcfg如果迁移问题应用于您的 Web 应用程序,请遵循这些步骤: