此规则会标记用于扩展 HttpServlet 的类,这些类未使用 setContentType() 方法来设置响应的内容类型。 WebSphere Application Server V5.1 中的缺省值为“text/html”,但 V6.0 中的缺省值已更改为“none”。 除了搜索继承了 setContentType() 方法调用的 HttpServlet 的类,该规则不会搜索其他任何类,因此,可能会将 HttpServletResponse 传递给另一个将调用 setContentType() 方法的类。 将需要手动扫描代码以找到此类。
可以设置 Web 容器定制属性 com.ibm.ws.webcontainer.contenttypecompatibility,以强制采用旧的行为。 如果此属性设置为 V4、V5、V6 或 V7,那么将基于所指定的版本来设置缺省 contentType。
有关设置该定制属性的更多信息,请参阅:
从 WebSphere Application Server V5.x 迁移 Web 应用程序组件