- Spring 5.0 Projects
- Nilang Patel
- 96字
- 2021-07-02 12:34:59
Managing static resources
If you look back at the com.nilangpatel.worldgdp.AppConfiguration class, you will see that we have overridden the addResourceHandlers method of WebMvcConfigurer interface. In the method implementation shown in the following code, we have mapped the static resources prefix URL /static/** to the static resources location /static/ in the webapp directory:
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**")
.addResourceLocations("/static/");
}
We have added a few static resources (both CSS and JavaScript) in the /src/main/webapp/static folder of the project. Please download the code of this chapter and refer to them side by side.
推薦閱讀
- 解析QUIC/HTTP3:未來互聯(lián)網(wǎng)的基石
- 物聯(lián)網(wǎng)安全與深度學(xué)習(xí)技術(shù)
- Hands-On Chatbots and Conversational UI Development
- 互聯(lián)網(wǎng)安全的40個(gè)智慧洞見:2015年中國互聯(lián)網(wǎng)安全大會(huì)文集
- 網(wǎng)絡(luò)的琴弦:玩轉(zhuǎn)IP看監(jiān)控
- WordPress Web Application Development
- The Kubernetes Workshop
- Learning Node.js Development
- 無線傳感器網(wǎng)絡(luò)定位技術(shù)
- 基于IPv6的家居物聯(lián)網(wǎng)開發(fā)與應(yīng)用技術(shù)
- 物聯(lián)網(wǎng)基礎(chǔ)及應(yīng)用
- 計(jì)算機(jī)通信網(wǎng)絡(luò)安全
- 人際網(wǎng)絡(luò)
- 算力網(wǎng)絡(luò):云網(wǎng)融合2.0時(shí)代的網(wǎng)絡(luò)架構(gòu)與關(guān)鍵技術(shù)
- 結(jié)網(wǎng)@改變世界的互聯(lián)網(wǎng)產(chǎn)品經(jīng)理(修訂版)