xmlet/HtmlFlow

Spring ViewResolver for HtmlFlow

fmcarvalho opened this issue · 2 comments

Regarding the sample spring application https://github.com/xmlet/spring-petclinic already integrated with HtmlFlow, enhance it with a ViewResolver. This resolver must obey with the strongly typed approach of HtmlFlow and avoid String to map views.

I'm not sure that we need to provide a way to use a ViewResolver.

To me it feels liberating that we don't need all the bells and whistles from spring mvc.
Simply calling render seems perfect to me.

Of course a description of how to implement it will be very helpfull

I think that we do not need the ViewResolver when routes return a String corresponding to the path of a view. Others need that because their views are text files in a resource folder. But HtmlFlow views are Java types that take advantage of static compilation.

Yet, there are some use cases where routes return directly a ModelAndView or even an object T of model and the view is inferred from the path request. For those cases the ViewResolver may be useful.

Nevertheless it has low priority.