JAVA WEB项目中web.xml拆分为多个

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app [
    <!ENTITY webServlet SYSTEM "web-servlets.xml">
]>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
   
  &webServlet;
   
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

 web-servlets.xml

<servlet>
    <servlet-name>SimpleServlet</servlet-name>
    <servlet-class>com.hongyuan.test.SimpleServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>SimpleServlet</servlet-name>
    <url-pattern>/SimpleServlet</url-pattern>
</servlet-mapping>

未经允许不得转载:小贱贱吧 | 分享身边的福利吧 » JAVA WEB项目中web.xml拆分为多个

赞 (0)
分享到:更多 ()

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址