- 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.
推薦閱讀
- 網(wǎng)絡(luò)協(xié)議工程
- Web安全防護(hù)指南:基礎(chǔ)篇
- Modern JavaScript Web Development Cookbook
- 數(shù)據(jù)通信網(wǎng)絡(luò)實(shí)踐:基礎(chǔ)知識(shí)與交換機(jī)技術(shù)
- OpenLayers Cookbook
- Learning Karaf Cellar
- 計(jì)算機(jī)網(wǎng)絡(luò)與數(shù)據(jù)通信
- Getting Started with Grunt:The JavaScript Task Runner
- OMNeT++與網(wǎng)絡(luò)仿真
- jQuery Mobile Web Development Essentials
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)及應(yīng)用
- 紅藍(lán)攻防:構(gòu)建實(shí)戰(zhàn)化網(wǎng)絡(luò)安全防御體系
- 一本書讀懂物聯(lián)網(wǎng)
- 數(shù)據(jù)血緣分析原理與實(shí)踐
- TCP/IP基礎(chǔ)(第2版)