Using Spring View Component with JTE Spring Boot: Making Them Work Together #10
Replies: 2 comments
-
|
Hello @robertellam, I think the problem is that the CodeResolver in DEV mode only looks in the src/main/resources #8 (comment) In Thymeleaf it works out of the box, so I need to add the CodeResolver that @DevAlves1993 created in Issue 8. I'm currently working on a build time processor that needs to compile jte inline and maybe your problem will be solved with that anyway: https://github.com/tschuehly/spring-view-component/blob/v0.6.2-SNAPSHOT/core/src/main/kotlin/de/tschuehly/spring/viewcomponent/core/processor/ViewComponentProcessor.kt |
Beta Was this translation helpful? Give feedback.
-
|
Responding pretty late here so maybe this is a non-issue now. I've gotten this to work as long as all your non-ViewComponent .jte are directly in src/main/java. Another issue I've found is that gradle jte plugin block requires specifying the
@Controller
public class DemoController {
private final SimpleViewComponent simpleViewComponent;
public DemoController(SimpleViewComponent simpleViewComponent) {this.simpleViewComponent = simpleViewComponent;}
@GetMapping("/")
public String view(Model model, HttpServletResponse response){
model.addAttribute("greeting", "Hello Whirled" );
return "demo";
}
@GetMapping("/vc")
public ViewContext vc(){
return simpleViewComponent.render();
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can I run regular Spring Boot JTE templates together with Spring View Components? I'm in the process of integrating Spring View Components into my existing Spring Boot Java application that uses JTE, but I'm facing some challenges in getting everything to function properly. If I decide to leverage Spring View Components, does that mean I have to convert all my existing JTE templates into components as well? Alternatively, is it feasible to invoke Spring View Components from within my current JTE templates?
Beta Was this translation helpful? Give feedback.
All reactions