fizzed / rocker

Java 8 optimized, memory efficient, speedy template engine producing statically typed, plain java objects
741 stars 89 forks source link

rocker-spring-boot-starter #111

Open iceant opened 5 years ago

iceant commented 5 years ago

Thanks for develop this greate template. It's simple and powerful. I used spring boot 2.x for web application development, but I can not find an integration with spring boot. So, I created one. Please check this: https://github.com/iceant/rocker-spring-boot-starter

Thanks.

damir78 commented 5 years ago

Hi @iceant ,

thanks for interesting implementation. There are few (rocker+spring-boot) - suggestions. Look for example https://github.com/linux-china/rocker-template-demo Personally, I like this simple integration. Regards

iceant commented 5 years ago

Hi, @damir78 Thanks for your comments. I have checked that demo before start to write my own. It make sence to use default implementation of Rocker. But I have more complex usage to use rocker with spring boot. For example, I use rocker to render web fragment(combined with 3 files: .js, .html, .css). There are 2 limitation in the default implementation:

  1. only support ".rocker.html" suffix. As you can see, I need to render .js and .css too. Yes, ".raw" is supported, but to make .js and .css with default file extension will make IDE friendly.
  2. I like the reload feature, just modify the template and refresh the page, everything is reloaded. That's so cool, and saved lots of my time for development. But rocker-compiler's default implementation had issue with that, TemplateCompiler can not handle classpath exactly. Also we need to config maven pom.xml to make that right. I'm lazy, I just want to import some jar files to make everything work. spring boot is good at that, so, I have to modify the default TemplateCompiler as RockerTemplateCompiler for that.

Also I used rocker for generate dynamic SQL and JavaBean to make coding simple and life easy. Again, Thanks for develop this greate tools. It's fast and simple.