Open odrotbohm opened 6 years ago
Please have a look at this demo project, that uses thymeleaf and spring-boot-2:
Controller: https://github.com/jochen777/jWebFormSpringBoot2Thymeleaf/blob/master/src/main/java/com/example/springboot2thymeleaf/demo_thymeleaf/web/DemoController.java (I even wrote a unit-test for this! :)
Do you think, that this is clean enough? I don't want to dive too deep into Thymeleaf, if possible. (But to be honest: The rendering in java is mostly not the best way. It is better located in the template engine. BUT this can be done in a central, generic way and have to be done just once for all forms)
I think this one is ready to close :-)
The sample is for an old unsupported version of Spring Boot. I couldn't run it with Spring Boot 3.3. It isn't anyway referenced in the docs for this project, so I would say the issue is still open.
As Thymeleaf is the most popular template engine with Spring application these days it would be cool if there was some documentation about how to use jWebForm with it. Maybe a very thin Thymeleaf dialect that allows the declaration as follows:
That could hide away the interaction with the jWebForm APIs in the controller.