Search code examples
templatesviewspring-roo

Modify how the generated views look like with Spring Roo without manually change each one post-creation?


A simple question. How may I change how Spring Roo generates it's views so I do not need to change them post-creation? If I were to follow the tutorial it would look like this, they however change the layout to this. From what I understand they have to change this manually after the view has been generated. What if I wanted the second view to be the base of all my generated views instead of the first one? Need I modify the source code or is there some simple way to override the generating code? Is it possible to set one base up for different projects?


Solution

  • Roo uses Tiles (used for templating) and JSP tags for all of that stuff, and has built-in theme handling as well. I believe in the tutorial for the Pizza shop, they are using a combination of modifing the Tiles templates AND a custom theme.

    Once you modify the default theme, which if memory serves is just some CSS put in the a special folder under WEB-INF, and modify the Tiles templates, and new pages you have Roo auto-generate will inherit the new look-and-feel.