how to map css and js file from jsp file in spring mvc

前端 未结 2 1354
夕颜
夕颜 2021-01-26 01:59

I am new to Spring mvc. I want to add css and js files in jsp. It\'s a spring mvc framework. This is my spring-dispatcher-servlet.xml code



        
2条回答
  •  无人及你
    2021-01-26 02:52

    In case you are still looking:

    Resource Mapping:

    
    

    Adding JS/CSS in jsp pages:

    ">
    
    

    Note: All of the JS/CSS files must be under src\main\webapp\resources directory.

    And if you have added Security, then you need to add this:

    
    

提交回复
热议问题