欢迎使用普元产品知识库,本知识库包含普元应用开发平台EOSPlatform,流程平台BPS,企业服务总线ESB,微服务平台Microservice,运维管理平台Devops,数据集成平台DI
欢迎使用普元文档库
普元 AppServer 6.5 业务应用使用了servlet注解,访问servlet报错:HTTP状态404-Not Found
业务应用使用了servlet的注解@WebServlet,应用web.xml里使用的web-app标签版本是2.3版本。从Servlet3.0开始,配置Servlet才能支持注解方式,当前2.3版本不支持注解方式。
业务应用使用了@WebServlet注解,web-app标签需要更改为3.0或以上版本。
修改方式如下:
修改应用web.xml的版本,例如:指定为3.1版本,同时建议将metadata-complete设置为false。
web-app配置示例如下:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1" metadata-complete="false">
metadata-complete属性值为true,则容器在部署时将只依赖部署描述文件,忽略所有的注解,metadata-complete属性值为false,则表示启用注解支持。
更多说明请查阅 < web-app>标签的metadata-complete属性的说明