Category Archives: Spring MVC

ViewModel functionality in DD4T 2.0 for Java Part III – Complex Field Types

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.

Continue reading

A new approach for serving images from a broker database

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?

Continue reading

Using the Thymeleaf view language

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!

Continue reading

ViewModel functionality in DD4T 2.0 for Java

As Quirijn already announced eloquently in his post on ViewModels in DD4T 2.0, the idea of making it easier to build a Tridion driven website for developers by introducing the ability to use simple model classes in your MVC application serving Tridion data, is one of the biggest improvements in the DD4T framework. With the public coming-out-of-beta release of DD4T 2.0 for Java, ViewModel functionality has also been fully integrated in the Java version of the framework. This series of posts focus on how ViewModels work in DD4T 2.0 for Java.

Continue reading