1. 程式人生 > >Struts2中的web.xml檔案

Struts2中的web.xml檔案

<filter>
    <!-- 配置Struts2核心Filter的名字 -->
        <filter-name>struts2</filter-name>
        <!-- 配置Struts2核心Filter的實現類 -->
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

程式碼中中Struts2核心Filter的 實現類,可以通過兩種方法找到:

第一種:通過類查詢,快捷鍵"Ctrl+Shift+T"可以開啟“Open Type”查詢StrutsPrepareAndExecuteFilter,進入後,可以複製

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter到web.xml中。

 第二種: