1. 程式人生 > >servlet web.xml配置檔案

servlet web.xml配置檔案

<web-app version="2.5"
    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_2_5.xsd">
    <!-- 配置初始開啟的頁面 -->
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

  <servlet>
     <!-- 類名 -->
    <servlet-name>GetServlet</servlet-name>
    <!-- 所在的包 -->
    <servlet-class>com.mucfc.chapter0.GetServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>GetServlet</servlet-name>
    <!-- 訪問的網址 -->
    <url-pattern>/servlet/GetServlet</url-pattern>
    </servlet-mapping>
</web-app>