Today we released version 2.0.7 of DD4T for Java. This version includes support for the Thymeleaf view language. Thymeleaf is a fast-growing view framework for Java web applications, which can be used as an alternative for JSP. I recently blogged about it as well.
In part II of these series on ViewModel functionality in dd4t–2-java, it was explained how to create ViewModel classes and how to implement basic field types for the mapping between Tridion fields and DD4T ViewModel properties.
This post handles the more complex field types. The reason we make a distinction between ‘simple’ and ‘complex’ is mainly because the complex field types have more options to be deserialized into and need quite some help from DD4T to know what they will become.
A picture says more than a thousand words, right? That’s why a web site needs images. In the old days before DD4T, the approach was very simple: out of the box, Tridion would publish your images to the file system, where the web server could pick them up and serve them out to the world.
But in the era of dynamic publishing, who wants to deploy to a file system anymore? One of the advantages of DD4T (or DXA, or any other dynamic framework) is that you publish everything to one central delivery store: the broker database. It makes sense to use this approach for images (and other binary file types) as well. But how?
SDL Web 8.5 (formerly known as SDL Tridion) is just around the corner. This release introduces a number of new features in Content Manager and functional changes in Content Manager Explorer, Content Delivery, Audience Manager and Translation Manager. Experience Optimization, formerly called SmartTarget, is part of SDL Web as of this release.
On a recent project of ours (Java/SDL Web 8/DD4T 2), the customer’s architect suggested to use a view language that I had – quite frankly – never heard of: Thymeleaf. I had always wondered why the Java world had never settled on a view technology to replace JSP. The way I see it, JSP has had a great run (it’s been around since 1999) but it belongs in the same category as ASP – a moloch from times of old. Although you can use JSP as the ‘V’ in ‘MVC’, it has never been a true view language. The support of inline java code means that developers can easily run amok, which can lead to messy and hard to maintain code bases. Also, JSP writes it output directly to the response, making it less flexible than more modern view technologies.
I have been waiting for a Java equivalent to .NET’s Razor: neat, clean syntax, intuitive switching between code and markup, and very well integrated into the framework. So when Thymeleaf was suggested, I thought – perhaps – this could be it!