Twitter bootstrap 带弹簧靴和引导带的Thymeleaf don';无法使用PathVariable在页面中工作
我有一个运行SpringBoot2.1.9.RELEASE、Thymeleaf和Boostrap4的应用程序 1) 我有一个base.html页面,用于创建以下模板:Twitter bootstrap 带弹簧靴和引导带的Thymeleaf don';无法使用PathVariable在页面中工作,twitter-bootstrap,spring-boot,bootstrap-4,thymeleaf,Twitter Bootstrap,Spring Boot,Bootstrap 4,Thymeleaf,我有一个运行SpringBoot2.1.9.RELEASE、Thymeleaf和Boostrap4的应用程序 1) 我有一个base.html页面,用于创建以下模板: <!DOCTYPE html> <html lang="pt-br" xmlns:th="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> <head&
<!DOCTYPE html>
<html lang="pt-br"
xmlns:th="http://www.w3.org/1999/xhtml"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<!-- Meta tags Obrigatórias -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="../static/css/bootstrap.min.css" th:href="@{css/bootstrap.min.css}">
<link rel="stylesheet" href="../static/css/custom.css" th:href="@{css/custom.css}">
<title th:text="${config.dashboardTitle}">None</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<th:block layout:fragment="page_content">PUT CONTENT HERE</th:block>
</div>
</div>
</div> <!-- /container -->
<script src="../static/js/jquery-3.3.1.slim.min.js" th:src="@{js/jquery-3.3.1.slim.min.js}"></script>
<script src="../static/js/popper.min.js" th:src="@{js/popper.min.js}"></script>
<script src="../static/js/bootstrap.min.js" th:src="@{js/bootstrap.min.js}"></script>
</body>
</html>
我的register application.html
在引导程序运行良好的情况下呈现,请参见页面:
<!DOCTYPE html>
<html lang="pt-br"
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{base}">
<head>
</head>
<th:block layout:fragment="page_content">
<div class="row">
<div class="col-md-12">
<form action="#" th:action="@{/register-application}" th:object="${application}" method="post">
<div class="form-group">
<label for="nameApp">Nome</label>
<input th:field="*{name}" type="text" class="form-control" id="nameApp" placeholder="Digite o nome da sua aplicação">
</div>
<button class="btn btn-outline-success" type="submit">Salvar</button>
</form>
</div>
</div>
</th:block>
</html>
呈现的页面完全相同(
register application.html
),但由于某些原因,引导未正确呈现,我在引导所需的脚本和样式表中遇到了大量404错误 我认为领先/领先的位置不见了。尝试:
<script type="text/javascript" th:src="@{/js/jquery-3.3.1.slim.min.js}"></script>
@GetMapping("/register-application/{guid}")
public String registerApp(Model model, @PathVariable("guid") String guid) {
loadDefaultModelConfig(model);
model.addAttribute("application", applicationMonitorRepository.getOne(guid));
return "register-application";
}
<script type="text/javascript" th:src="@{/js/jquery-3.3.1.slim.min.js}"></script>