- 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.
推薦閱讀
- CorelDRAW X6 中文版圖形設計實戰從入門到精通
- C++黑客編程揭秘與防范
- Hands-On Chatbots and Conversational UI Development
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- 智慧城市中的移動互聯網技術
- 物聯網時代
- 城域網與廣域網(第2版)
- Unity Artificial Intelligence Programming
- 搶占下一個智能風口:移動物聯網
- INSTANT KineticJS Starter
- 5G技術與標準
- Android UI Design
- Learning Node.js Development
- 計算機通信網絡安全
- 5G智慧交通