im using fragments like this:
@RequestMapping(value="/fragment/nodeListWithStatus", method= RequestMethod.GET) public String nodeListWithStatus(Model model) { // status der nodes model.addAttribute("nodeList", nodeService.getNodeListWithOnlineStatus()); return "/fragments :: nodeList"; } The templates are in /src/main/resources/templates. This works fine when starting the application from IntelliJ. As soon as i create an .jar and start it, above code no longer works. Error:
[2014-10-21 20:37:09.191] log4j - 7941 ERROR [http-nio-666-exec-2] --- TemplateEngine: [THYMELEAF][http-nio-666-exec-2] Exception processing template "/fragments": Error resolving template "/fragments", template might not exist or might not be accessible by any of the configured Template Resolvers When i open the .jar with winrar, i see /templates/fragments.html - so it seems to be there.
My pom.xml has this part for building the jar (Maven clean, install) :
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>de.filth.Application</mainClass> <layout>JAR</layout> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> Can anyone tell me what im doing wrong here?
Thanks!