Templating in the MVC JSR - No Fluff Just Stuff

Templating in the MVC JSR

Posted by: Reza Rahman on March 12, 2015

One of the underlying requirements of the JSR 371 was to not re-invent any VDL (View Declaration/Definition Language) because the Java EE Platform already provides that capability in 2 different forms, i.e. JSP and Facelets. In addition, the templating solution space is already very mature (and very crowded too!), it would be a complete waste to re-invent anything around that!

So instead of spending energy in re-inventing the (template) wheel, it makes more sense to spend energy in allowing to cleaning use, from the MVC API, the existing templating solutions provided by the platform: JSP & Facelets (see the javax.mvc.engine.ViewEngine interface). 

One additional benefit of that approach is that the MVC API is not limited to just JSP and Facelets. It will also be possible to cherry pick and easily plug-in your preferred templating solution to any MVC JSR implementation.

Next to JSP and Facelets, Ozark (JSR 371 Reference Implementation) already support some additional templating solutions: FreeMarkerVelocityMustacheHandlebars and soon Thymeleaf. Some of those were contributed by Rodrigo Turini and Rahman Usta.

Do you see any templating solution missing?

If so, it's probably just one contribution away!

Disclamier: it's early days, expect things to evolve!

Reza Rahman

About Reza Rahman

Reza is a recovering independent consultant and now Java EE evangelist at Oracle. He is the author of the popular book EJB 3 in Action. Reza is a frequent speaker at developer gatherings worldwide including JavaOne and NFJS. He is an avid contributor to community sites like JavaLobby and TSS. Reza has been a member of the Java EE, EJB and JMS expert groups. He implemented the EJB container for the Resin open source Java EE application server.

All views voiced are squarely mine alone, not Oracle's.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »