W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
首先用您習(xí)慣的 IDE 工具創(chuàng)建一個 Web 工程,然后在 web.xml 中加入 Hasor 的啟動監(jiān)聽器和全局 Filter。
<listener>
<listener-class>net.hasor.web.startup.RuntimeListener</listener-class>
</listener>
<filter>
<filter-name>rootFilter</filter-name>
<filter-class>net.hasor.web.startup.RuntimeFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>rootFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
接著需要您在您的項目中創(chuàng)建一個 Hasor 啟動入口類。
package net.demo.core;
public class StartModule extends WebModule {
public void loadModule(WebApiBinder apiBinder) throws Throwable {
...
}
}
最后您需要將啟動入口配置到 Hasor 啟動參數(shù)中,在 Hasor 中配置啟動入口有很多方式。下面我們采用在 web.xml 中配置的方式,在 web.xml 中加入如下配置:
<context-param>
<param-name>startModule</param-name>
<param-value>net.demo.core.StartModule</param-value>
</context-param>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: