Я не могу получить ни блог. html, ни другие htmls с попыткой localhost: 8080 / blog. Когда я пытаюсь получить доступ / путь к блогу, я получаю страницу ошибки Whitelabel, поэтому ее 404 не найдено, и в журнале консоли я вижу предупреждение "ResourceHttpRequestHandler : Path represents URL or has "url:" prefix: [classpath:/templates/blog.html]
". Когда я изменяю свой @controller на @restcontroller, я могу получить доступ к пути / блогу, но с @controller я не могу получить к нему доступ. Заранее спасибо
структура моего проекта:
Testt. java поэтому мой контроллер класса:
@Controller public class Testt {
@GetMapping(path = "/blog") public String getAbout() { return "blog"; }
}
SecurityConfig. java поэтому мой весенний класс конфигурации безопасности:
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().authorizeRequests().antMatchers(HttpMethod.GET).permitAll();
}
}
EstoreAppApplication. java мой подпружиненный загрузчик java класс:
@SpringBootApplication
public class EstoreAppApplication {
public static void main(String[] args) {
SpringApplication.run(EstoreAppApplication.class, args);
}
}
мое приложение свойства:
spring.mvc.view.prefix=classpath:/templates/
spring.mvc.view.suffix=.html