With Waffle you can write views with either Java Server Pages, FreeMarker or Velocity. Other view technologies, like Tiles will also work. Decoration technologies like Sitemesh are quite compatible with Waffle (see our Freemarker example).
Using Java Server Pages in Waffle is as easy as it is with other frameworks. You'll be able to reference the Controller that is asscoaiated with the view by the controller keyword. In the jspx example below the getName() method will be invoked from the Controller:
You will also need to set the default view suffix parameter on the WaffleServlet so that actions can be routed to the correct view. The following is an exerpt from the web.xml file:
Note that .jspx being the default view suffix for Waffle, the 'init-param' for it could be left out entirely (and is in some our examples).
FreeMarker views can be written like any FreeMarker pages for other web frameworks. For the most part it is best to follow the documentation FreeMarker provides. Similarly to the JavaServer Pages definition above you will need to register the default view suffix accordingly for FreeMarker (typically .ftl).
You will need to register the freemarker.ext.servlet.FreemarkerServlet in the web.xml:
Again, see our working Freemarker example.
As with the JavaServer Pages and FreeMarker descriptions above you can access the actions from your Velocity script via the action keyword. The example below shows how you should register the Servlet to handle Velocity based pages: