VRaptor3 also supports controllers written in Scala. The required configurations and an example are featured in this chapter.

Dependencies and Configuration

The following jars must be added to your applications's WEB-INF/lib directory:

Now, VRaptor must be configured to load the relevant plugins. In the web.xml file, define the context-param section as below:


Then, add to the file the required changes to use Scalate as the view:




A VRaptor3 controller written in Scala:

class MyController {

    def myLogic = "Hello, world!"