Spring Boot 프로젝트에서 리소스 폴더를 설정하려고합니다. 그러나 그것을 만들 수 없습니다. 도와주세요. 나는 thymeleaf를 통합하려고합니다.Spring Boot 및 Thymeleaf 리소스 폴더 문제
나는 index.html을 을 얻을 수 있어요하지만 index.html을에서 자원 /css/mobile-angular-ui-desktop.min.css 파일을 포함 할 수 없습니다입니다. 404 페이지를 찾을 수 없습니다. 오류가 발생했습니다.
index.html을
<!DOCTYPE html>
<html>
<head>
<title>Provision Admin</title>
<link rel="stylesheet" th:href="@{/css/mobile-angular-ui-base.min.css}"
href="../static/css/mobile-angular-ui-base.min.css" />
<link rel="stylesheet"
href="/css/mobile-angular-ui-desktop.min.css" />
<script type="text/javascript">
var appContext = '/profilebatch';
</script>
</head>
<body>
</body>
</html>
나는 다음과 같은 보안 설정.
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
protected static class ApplicationSecurity extends
WebSecurityConfigurerAdapter {
@Autowired
private SecurityProperties security;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().authorizeRequests().antMatchers("/css/**")
.permitAll().antMatchers("**/favicon.ico").permitAll()
.antMatchers("/secure/**").fullyAuthenticated().and()
.formLogin().loginPage("/login").failureUrl("/login?error")
.permitAll().and().logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/login");
}
@Override
public void configure(AuthenticationManagerBuilder auth)
throws Exception {
auth.inMemoryAuthentication().withUser("user").password("user")
.roles("USER").and().withUser("admin").password("admin")
.roles("ADMIN");
}
}
실제 렌더링 된 HTML의 'href'는 어떤 모양입니까? – chrylis