Мой класс конфигурации безопасности равен
private static final String[] PUBLIC_MATCHERS = {
"/css/**",
"/js/**",
"/images/**",
"/",
"**/",
"/newUser",
"/forgetPassword",
"/login",
"**/uploads/**",
"/assets/**",
"/api/updateCardStatus",
"/users",
"/fonts/**"
};
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
/* antMatchers("/**").*/
.antMatchers(PUBLIC_MATCHERS).
permitAll().anyRequest().authenticated();
http
.authorizeRequests()
.antMatchers("/admin").hasAnyRole("ROLE_ADMIN").and()
.formLogin().loginPage("/login").permitAll().failureUrl("/login?error")
.successHandler(securityHandler)
.and()
.logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/?logout").deleteCookies("remember-me").permitAll()
.and()
.rememberMe();
}
мой HTML-файл состоит из нескольких шаблонов
admin.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="common/header :: common-header"/>
<body class="">
<div class="wrapper">
<div th:replace="common/header :: common-sidebar"/>
<div class="main-panel">
<!-- Navbar -->
<div th:replace="common/header :: common-navbar"/>
<!-- End Navbar -->
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="card card-stats">
<div class="card-header card-header-warning card-header-icon">
<div class="card-icon">
<i class="material-icons">weekend</i>
</div>
<p class="card-category">Bookings</p>
<h3 class="card-title">184</h3>
</div>
<div class="card-footer">
<div class="stats">
<i class="material-icons text-danger">warning</i>
<a href="#pablo">Get More Space...</a>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="card card-stats">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">equalizer</i>
</div>
<p class="card-category">Website Visits</p>
<h3 class="card-title">75.521</h3>
</div>
<div class="card-footer">
<div class="stats">
<i class="material-icons">local_offer</i> Tracked from Google Analytics
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="card card-stats">
<div class="card-header card-header-success card-header-icon">
<div class="card-icon">
<i class="material-icons">store</i>
</div>
<p class="card-category">Revenue</p>
<h3 class="card-title">$34,245</h3>
</div>
<div class="card-footer">
<div class="stats">
<i class="material-icons">date_range</i> Last 24 Hours
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="card card-stats">
<div class="card-header card-header-info card-header-icon">
<div class="card-icon">
<i class="fa fa-twitter"></i>
</div>
<p class="card-category">Followers</p>
<h3 class="card-title">+245</h3>
</div>
<div class="card-footer">
<div class="stats">
<i class="material-icons">update</i> Just Updated
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div th:replace="common/footer :: footer"></div>
</div>
</div>
<div th:replace="common/footer :: scriptone"></div>
</body>
</html>
так что теперь, когда я вхожу, я успешно попадаю на страницу admin.html. но только некоторые папки внутри моей папки активов загружены.
например, я определил фрагмент скриптона следующим образом: -
<div th:fragment="scriptone">
<script th:src="@{/assets/js/core/jquery.min.js}"></script>
<script th:src="@{/assets/js/core/popper.min.js}"></script>
<script th:src="@{/assets/js/bootstrap-material-design.min.js}"></script>
<script th:src="@{/assets/js/plugins/perfect-scrollbar.jquery.min.js}"></script>
<!-- Google Maps Plugin -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB2Yno10-YTnLjjn_Vtk0V8cdcY5lC4plU"></script>
<!-- Plugin for Date Time Picker and Full Calendar Plugin -->
<script th:src="@{/assets/js/plugins/moment.min.js}"></script>
<!-- Plugin for the Datepicker, full documentation here: https://github.com/Eonasdan/bootstrap-datetimepicker -->
<script th:src="@{/assets/js/plugins/bootstrap-datetimepicker.min.js}"></script>
<!-- Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script th:src="@{/assets/js/plugins/nouislider.min.js}"></script>
<!-- Plugin for Select, full documentation here: http://silviomoreto.github.io/bootstrap-select -->
<script th:src="@{/assets/js/plugins/bootstrap-selectpicker.js}"></script>
<!-- Plugin for Tags, full documentation here: http://xoxco.com/projects/code/tagsinput/ -->
<script th:src="@{/assets/js/plugins/bootstrap-tagsinput.js}"></script>
<!-- Plugin for Fileupload, full documentation here: http://www.jasny.net/bootstrap/javascript/#fileinput -->
<script th:src="@{/assets/js/plugins/jasny-bootstrap.min.js}"></script>
<!-- Plugins for presentation and navigation -->
<script th:src="@{/assets/assets-for-demo/js/modernizr.js}"></script>
<!-- Material Kit Core initialisations of plugins and Bootstrap Material Design Library -->
<script th:src="@{/assets/js/material-dashboard790f.js?v=2.0.1}"></script>
<!-- Include a polyfill for ES6 Promises (optional) for IE11, UC Browser and Android browser support SweetAlert -->
<script src="../../../cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js"></script>
<!-- Library for adding dinamically elements -->
<script th:src="@{/assets/js/plugins/arrive.min.js}" type="text/javascript"></script>
<!-- Forms Validations Plugin -->
<script th:src="@{/assets/js/plugins/jquery.validate.min.js}"></script>
<!-- Charts Plugin, full documentation here: https://gionkunz.github.io/chartist-js/ -->
<script th:src="@{/assets/js/plugins/chartist.min.js}"></script>
<!-- Plugin for the Wizard, full documentation here: https://github.com/VinceG/twitter-bootstrap-wizard -->
<script th:src="@{/assets/js/plugins/jquery.bootstrap-wizard.js}"></script>
<!-- Notifications Plugin, full documentation here: http://bootstrap-notify.remabledesigns.com/ -->
<script th:src="@{/assets/js/plugins/bootstrap-notify.js}"></script>
<!-- Vector Map plugin, full documentation here: http://jvectormap.com/documentation/ -->
<script th:src="@{/assets/js/plugins/jquery-jvectormap.js}"></script>
<!-- Sliders Plugin, full documentation here: https://refreshless.com/nouislider/ -->
<script th:src="@{/assets/js/plugins/nouislider.min.js}"></script>
<!-- Plugin for Select, full documentation here: http://silviomoreto.github.io/bootstrap-select -->
<script th:src="@{/assets/js/plugins/jquery.select-bootstrap.js}"></script>
<!-- DataTables.net Plugin, full documentation here: https://datatables.net/ -->
<script th:src="@{/assets/js/plugins/jquery.datatables.js}"></script>
<!-- Sweet Alert 2 plugin, full documentation here: https://limonte.github.io/sweetalert2/ -->
<script th:src="@{/assets/js/plugins/sweetalert2.js}"></script>
<!-- Plugin for Fileupload, full documentation here: http://www.jasny.net/bootstrap/javascript/#fileinput -->
<script th:src="@{/assets/js/plugins/jasny-bootstrap.min.js}"></script>
<!-- Full Calendar Plugin, full documentation here: https://github.com/fullcalendar/fullcalendar -->
<script th:src="@{/assets/js/plugins/fullcalendar.min.js}"></script>
<!-- demo init -->
<script th:src="@{/assets/js/plugins/demo.js}"></script>
</div>
Теперь я ожидаю, что это будет работать правильно, но, к сожалению, это не работает. Я посмотрел на источники браузера и увидел, что загружаются только некоторые из папок внутри ресурсов.
хотя у меня есть и другие папки
так что теперь, когда я загружаю свою страницу admin.html, появляется только боковая панель. другое содержимое не отображается. мне интересно почему?