Has anybody familiar with Spring and Velocity.
Spring 5 onwards Velocity support has been removed. I am currently using SPRING 4.1.6. I want to upgrade to 5.2.x.
Which is the best template engine suitable for this.

  • 0
    Mustache is the most popular at the moment. Upgrade to 4.3 immediately and work up from there. If you're on 4.1 you're missing security patches.

    In generally I prefer to create SPAs, and expose APIs to provide data. The resource costs for rendering html on the server is massive when you could have clients doing the work instead. Spring MVC is antiquated as a paradigm.
  • 0
    @SortOfTested Thank you for your suggestion. This seems to be logicless templates where we cannot write the if-else conditions etc..
    In my old velocity templates, I do have such conditions.
  • 0
    I've used freemarker and found it is easy enough to use, I only really had experience with flask's jinja2 in Python before now.

    You could just add the velocity dependency manually and add a bean to interface with it probably though.
  • 1
    See the most highly upvoted answer (not the accepted one) here: https://stackoverflow.com/questions...

    You can still use it, but you need to do the configuration yourself and it's a bit of a pain.

    Popular templating engines seem to come and go a bit like JS frameworks at the moment. Personally I'm all for Thymeleaf, but I daresay that'll disappear soon enough and be replaced by something else 🙃
  • 0
    There's nothing stopping you making a simple autoconfiguration springfactory and putting it up on maven central.

    Pop dependabot on it and set up a basic release workflow on GitHub and as long as velocity doesn't change their API drastically, it should be mostly self-maintaining. It will then benefit anyone else in the same position :-)
Add Comment