Uh oh!
There was an error while loading. Please reload this page.
Make AbstractTemplateEngine#init method final, use lazy instantiation - #591
Conversation
mhagnumdw
commented
Nov 29, 2021
@decebals , I took a look over and it looks ok. Tomorrow I will test it with my application that uses Freemarker. Then I come back here. |
mhagnumdw
commented
Nov 30, 2021
@decebals , please see this comment: d0793e2#r61118560-permalink |
decebals
commented
Nov 30, 2021
My idea is to bring each component where is used. Now many components extract dependencies from I recognize that now is a little bit verbose to set a custom Please feel free to say what you think, because your feedback is important to me. |
decebals
commented
Nov 30, 2021
Remove |
I did as in the test class above and in my application I got the error stack below: Error: So I needed to set the publicclassPippoApplicationextendsControllerApplication {
@OverrideprotectedvoidonInit() {
ControllerFactorycontrollerFactory = newGuiceControllerFactory(injector);
ControllerHandlerFactorycontrollerHandlerFactory = newDefaultControllerHandlerFactory()
.setControllerFactory(controllerFactory)
.setContentTypeEngines(getContentTypeEngines()) // <<< I had to define here
;
ControllerRouteFactorycontrollerRouteFactory = newDefaultControllerRouteFactory()
.setControllerHandlerFactory(controllerHandlerFactory)
;
setControllerRouteFactory(controllerRouteFactory);
}
}If I don't set the engines in the |
mhagnumdw
commented
Nov 30, 2021
oops, I'll check this change... |
mhagnumdw
commented
Nov 30, 2021
@decebals , the observation I made above #591 (comment) is still valid. It was necessary to set: ControllerFactorycontrollerFactory = newGuiceControllerFactory(injector);
ControllerRouteFactorycontrollerRouteFactory = newDefaultControllerRouteFactory()
.setControllerFactory(controllerFactory)
.setContentTypeEngines(getContentTypeEngines()) // <<< I had to define here - getting from Application
;
setControllerRouteFactory(controllerRouteFactory); |
decebals
commented
Nov 30, 2021
Yes. We will see in the future if we can improve this. |
decebals
commented
Nov 30, 2021
From what I see, we don't need By the way, the new release will be |
mhagnumdw
commented
Nov 30, 2021
Well... these changes worked in my application with the modifications I mentioned earlier. I will then approve this PR. |
decebals
commented
Nov 30, 2021
I don't understand. Is it works and I can merge it or do you need more time for a test? |
The goal of this PR is to facilitate #590.
I think that now the code looks better and the performance is a little better (using lazy instantiation).