微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

静态内容不会在Spring Boot应用程序中加载

如何解决静态内容不会在Spring Boot应用程序中加载

我正在使用弹簧靴和小胡子。我尝试用静态CSS加载页面,但是样式不随页面加载。以前,当我遇到相同的问题时,我只是将所有静态内容都放在一个静态目录中,但现在对我没有帮助。以前我使用过Spring Security,但现在没有。不要以为这没有任何关系。 这是我的html:

<html>
<head>
        <link href="/css/style.css" rel="stylesheet" type="text/css">
        <script src="/js/script.js"></script>
</head>
<body>
<div>
    <div class="table">
        <form method="get" action="filter" class="table">
            <input type="text" name="caller" placeholder="Caller"/>
            <input type="text" name="destination" placeholder="Call recpient"/>
            <input type="date" id="dateFrom" name="dateFrom">
            <input type="date" id="dateto" name="dateto">
            <input type="time" id="timeFrom" name="timeFrom">
            <input type="time" id="timeto" name="timeto">
            <button type="submit">Find</button>
        </form>
    </div>
</div>
<div>
    <table class="table">
        <thead>
        {{#listofCalls}}
            <tr>
                <th>{{name}}</th>
                <th>{{caller}}</th>
                <th>{{destination}}</th>
                <th>{{date}}</th>
                <th>{{timeFrom}}</th>
                <th>{{timeTill}}</th>
                <th>{{lengthOfCall}}</th>
            </tr>
        {{/listofCalls}}
        </thead>
    </table>
</div>
</body>
</html>

这是我的资源文件夹层次结构: https://i.stack.imgur.com/dwOcu.png

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。