Closed stianl closed 11 months ago
The thing is, you can have multiple parameters inside the modelmap. So yes, if you have only one "model parameter" it would make it a little simpler, but you would end up having two different approaches when having multiple model parameters.
Since there's been relatively low support for this, and I personally think we should keep the amount of magic as low as possible, I'm closing this now as not planned.
I just looked at the README.md for jte-spring-boot-starter-3 and - taking a little inspiration from .NET Razor templates - I wondered if it'd be possible to simplify the usage even further?
I know that @import is not needed if specifying fully qualified class name, so I can write just
@param com.example.demo.DemoModel model
. But what if the model name is always model? Could we just do@model com.example.demo.DemoModel
?What if we could leave out the name of the model here too - just always let it be "model"? I can return ModelAndView from a Spring controller, but there's no constructor taking a view name and model. I guess there could be one (that'd just set the model name to "model")? Like JteModelAndView? 🤔 Something like this?
Or, maybe something like @JteController (or @Controller + @Jte ?) that would render the view with the same name as the method - and use the return value as "model"?