弹出成功登录结果显示js / bootstrap.min.js

时间:2015-11-25 04:59:19

标签: javascript html5 spring-mvc

我有一个带有Spring安全性的Spring Boot 1.3.0.BUILD-SNAPSHOT用于身份验证。我有一个layout.html页面供我的其他页面使用。

当我转到我的login.html:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
     <link href="/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/css/custom.css" rel="stylesheet" type="text/css"/>
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"/>
    <script src="/libs/jquery-1.11.3.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body>
<div th:replace="layout :: head">&nbsp;</div>
<div style="padding-top:60px;">
....
</div>
<div th:include="layout :: foot"/>
</body>
</html>

这是我的布局:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<body>

<div th:fragment="head" class="my-header">
    <div class="navbar navbar-default navbar-fixed-top navbar-transparent" role="navigation">
...
</div>
</body>
</html>

表单提交POST,返回302: enter image description here

然后将url重定向到http://localhost:9001/js/bootstrap.min.js而不是http://localhost:9001/,以便浏览器只显示bootstrap js文件的内容。如果我手动将URL更改为http://localhost:9001,则会显示我的经过身份验证的窗口。所有其他页面都表现正常,它只是显示js文件内容的登录页面。

我无法弄清楚显示js / bootstrap.min.js的调用来自哪里,我grep了我的文件,所有引用的格式都是:

<script src="/libs/jquery-1.11.3.min.js"></script>
<script src="/js/bootstrap.min.js"></script>

感谢您抽出时间阅读本文并就可能导致此问题的原因提供任何建议。

0 个答案:

没有答案
相关问题