Spring MVC - include static files / javascript , css

后端 未结 7 1995
猫巷女王i
猫巷女王i 2021-01-02 06:48

I have created MVC application.

I want to include js or css file into jsp.

My static files ar under:

- webapp
        -js/jquery.js
        -WEB-I         


        
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-02 07:38

    I agree with your answer. But in the style.css file declare url that relate to path of image.

    --style.css--

    .cwt-object0
    {
        display: block;
        left: 2.62%;
        margin-left: -1px;
        position: absolute;
        top: 43px;
        width: 64px;
        height: 64px;
        background-image: url('/resources/images/object0.png');
        background-position: 0 0;
        background-repeat: no-repeat;
        z-index: 0;
    }
    

    How to use tag in style.css file to see in browser IE/Firefox

    --jsp file ---

    " rel="stylesheet" type="text/css" media="screen">
    

提交回复
热议问题