If you are looking for a templating framework to use with Spring MVC I recommend using Spring's Thymeleaf.
This answer also provides some valuable feedback relating to the issue: HTML templates in spring boot similar to play framework
Spring framework does not force you to use any particular view
technology. You can use anything that can be integrated. The topic is
covered in the documentation
(https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-view)
where you can read about the details on popular choices. However, the
most popular is Thymeleaf, which used to be a part of Spring MVC
before separation into an independent project. You can find a clear
example on how to use it with Spring Boot in the getting started
guide.
The templates in Play framework created using Twirl framework are
converted into Scala code. You simply pass the data model via template
parameter list, just like you do with any method.
In Spring framework you put all date that you want to expose to your
view in a so-called model map, which is a simple key-value storage. In
the view technology you refer the values using corresponding keys.