java.lang.Object
io.jstach.opt.spring.webflux.example.hello.HelloController

@Controller public class HelloController extends Object
Example hello world controller using different ways to use JStachio for web development.
Author:
agentgt
  • Constructor Details

  • Method Details

    • hello

      Here we use JStachio runtime to resolve the renderer (in this case we are calling them Views) via Springs Http Message Converter.
      Returns:
      the model that will be used to find the correct view and then rendered using that view
      See Also:
      API Note
      Notice that the method has to be annotated with @ResponseBody.
    • mvc

      @GetMapping("/mvc") public View mvc()
      Here we use JStacheInterfaces to make our model implement a Spring View to support the traditional servlet MVC approach. The model will use the static jstachio singleton that will be the spring one.

      This approach has pros and cons. It makes your models slightly coupled to Spring MVC but allows you to return different views if say you had to redirect on some inputs (RedirectView).

      Returns:
      the model that will be used as View
      See Also:
      API Note
      Notice that the return type is View.