У меня есть файл base.html, в который я поместил все свои файлы css и js, и он работает нормально, когда я определяю URL без "/".
Вот мой код
мой контроллер
@GetMapping("/department/list")
public String getAllDepartment(Model model) {
model.addAttribute("departments", repository.findAll());
return "department/list";
}
при нажатии определить URL-адрес только "/ list" он работает нормально и все css и jss работают хорошо, но при определении "/ отдела / списка" этот URL-адрес не загружается. Css и jss
на мой взгляд
вот мой base.html
<html dir="ltr" lang="en" class="no-outlines"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org">
<head>
<title>Meetup</title>
<link rel="stylesheet" th:href="@{assets/css/style.css}">
</head>
<body>
<div class="wrapper">
<main class="main--container">
<section class="main--content"
layout:fragment="content">
</section>
</main>
</div>
<script th:src="@{assets/js/jquery.min.js}"></script>
<script th:src="@{assets/js/main.js}"></script>
</body>
</html>
вот мой list.html
<!doctype html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{base}">
<head>
<title>Department</title>
</head>
<body>
<section class="main--content" layout:fragment="content">
<div class="row gutter-20">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<h3 class="panel-title">Department Information</h3>
</div>
<div class="records--list" data-title="Orders Listing">
<table id="recordsListView">
<thead>
<tr>
<th>Order No</th>
<th>Order ID</th>
<th>Purchesed On</th>
<th>Customer Name</th>
<th>Ship To</th>
<th>Total Price</th>
<th>Payment</th>
<th>Status</th>
<th class="not-sortable">Actions</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
вот структура файла моего проекта
