java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
io.jstach.opt.spring.web.JStachioHttpMessageConverter
- All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<Object>
public class JStachioHttpMessageConverter
extends org.springframework.http.converter.AbstractHttpMessageConverter<Object>
Typesafe way to use JStachio in Spring Web.
For this to work the controllers need to return JStache models and have the controller
method return annotated with ResponseBody
.
Example:
@JStache
public record HelloModel(String message){}
@GetMapping(value = "/")
@ResponseBody
public HelloModel hello() {
return new HelloModel("Spring Boot is now JStachioed!");
}
- Author:
- agentgt
-
Constructor Summary
ConstructorDescriptionJStachioHttpMessageConverter
(JStachio jstachio) Create http converter from jstachio -
Method Summary
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes
-
Constructor Details
-
JStachioHttpMessageConverter
Create http converter from jstachio- Parameters:
jstachio
- an instance usually created by spring
-
-
Method Details