I have worked with PlayFramework for Scala. Now I am starting with Spring (Spring Boot) for the first time. Is their any way to make HTML templates similar to Play framework. e.g. passing HTML content into a main(main.scala.html) HTML file.
相关问题
- Dependency injection into Logback Appenders with S
- PlayFramework: how to transform each element of a
- Deserialize duplicate keys to list using Jackson
- org.apache.commons.fileupload.disk.DiskFileItem is
- How can I access the repository from the entity in
相关文章
- spring-mvc a标签带参怎样向controller发送请求。路径格式?
- How to load @Configuration classes from separate J
- Java spring framework - how to set content type?
- Java/Spring MVC: provide request context to child
- Spring 5 Web Reactive - Hot Publishing - How to us
- Using Spring Dynamic Languages Support from Groovy
- how to set H2 primary key id to auto_increment?
- Spring JMS : Set ErrorHandler for @JmsListener ann
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 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.