Помогите! Вот такая ошибка:
Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
Небольшой контролер:
@Controller
@RequestMapping("/view")
public class ViewController {
@RequestMapping("/index")
public String helloView(Model model) {
model.addAttribute("test", "Hello test");
return "index";
}
}
Bean:
@Configuration
public class BeanConfig {
@Bean
public InternalResourceViewResolver setupViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("WEB-INF/views/");
resolver.setSuffix(".jsp");
resolver.setViewClass(JstlView.class);
return resolver;
}
}
Application:
@Configuration
@ComponentScan("com.samuliak")
@SpringBootApplication
@Import(BeanConfig.class)
public class ProjectApplication extends SpringBootServletInitializer{
@Override
protected SpringApplicationBuilder configure (SpringApplicationBuilder application) {
return application.sources(ProjectApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(ProjectApplication.class, args);
}
}
Скрин пути к вьюхам:
Build.gradle:
buildscript {
ext {
springBootVersion = '1.5.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '1.5.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.2.2.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '1.5.3.RELEASE'
compile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '9.0.0.M21'
compile("javax.servlet:jstl:1.2")
compile group: 'org.eclipse.jdt.core.compiler', name: 'ecj', version: '4.4.2'
compile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
1 поставить:
resolver.setPrefix("/WEB-INF/views/");
вместо:
resolver.setPrefix("WEB-INF/views/");
2 убрать из зависимостей
compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '1.5.3.RELEASE'
Кофе для программистов: как напиток влияет на продуктивность кодеров?
Рекламные вывески: как привлечь внимание и увеличить продажи
Стратегії та тренди в SMM - Технології, що формують майбутнє сьогодні
Выделенный сервер, что это, для чего нужен и какие характеристики важны?
Современные решения для бизнеса: как облачные и виртуальные технологии меняют рынок
ЗдравствуйтеИмеется класс унаследованный от LinearLayout, в котором среди прочих элементов имеется ImageView
У меня есть список блюд оформленный в виде карточек, при нажатии на карточке кнопки добавить должно происходить добавление раздел basket id этого...
Всем привет) Решил я сделать боковое меню на сайте, написал данный код, но столкнулся с проблемой, ссылки не кликабельны мышкойОни кликабельны...