Fork this page on GitHub


The console that helps you scalate!


The Scalate console is designed to make it easier to work on your Scalate web application. The console is implemented using a WAR Overlay, so its as simple as adding a single dependency to your maven pom.xml.

The console provides edit links to the current JAXRS resource class (if it can figure it out) together with all the templates that have been used to render the current page; including any includes and layout files. If you want to edit one of the files you can just click on the links.

If you make a typo in a template, the console will render a nice error page together with the line and column where the error occurred and edit links so you can fix the mistake quickly.

If you get a stack trace, Scalate will show the line/column of the template in the stack trace, so you can easily click and edit the template which caused an exception to occur.

In addition the console provides easy access to view

  • the source of the main output of the current template (before layout)
  • the attributes available to Scalate when rendering occurred
  • the system properties in the JVM
  • links to let you create new resources and templates from archetype templates

The best way to get started with the Scalate Console is to try out the Getting Started Guide

How edit links work

The Scalate Console is a web application that uses hypertext links to the source code, so that its easy in development mode to navigate from a browser page in your web application to the relevant source code.

If you are on OS X and have TextMate installed (in /Applications/ or ~/Applications/ then by default the links will cause the file to be opened in TextMate. Otherwise the default behaviour is to use regular file:/// links.

If you want to open scala and template files in Eclipse or IDEA then

  • install the Atlassian IDE Connector which provides a URL scheme for opening files in your IDE
  • either
    • set the system property scalate.editor to be ide when you run your web app in tomcat/jetty
    • set the environment variable SCALATE_EDITOR to ide when running your application via mvn jetty:run
  • restart your application, now all source code links in the Scalate console will open the files inside your IDE (assuming you have the project already open that is)

See Also

  • WAR Overlay describes how we use a WAR overlay to include the Console in your application
  • Documentation for further information on user guides and template references