Our application is already great but it seriously leaves something to be desired in terms of aesthetics. You may have heard of material design. It is Google's take on flat design.
We will use Materialize (http://materializecss.com), a great looking responsive CSS and JavaScript library, just like Bootstrap.
We talked a bit about WebJars in Chapter 1, Setting Up a Spring Web Application in No Time; we will now get to use them. Add jQuery and Materialize CSS to our dependencies:
compile 'org.webjars:materializecss:0.96.0' compile 'org.webjars:jquery:2.1.4'
The way a WebJar is organized is completely standardized. You will find the JS and CSS files of any library in /webjars/{lib}/{version}/*.js
.
For instance, to add jQuery to our page, the following to a web page:
<script src="/webjars/jquery/2.1.4/jquery.js"></script>
Let's modify our controller so that it gives us a list of all tweet objects instead of simple text:
package masterSpringMvc.controller; import...