Because Scala code is compiled into Java bytecode, you can code your web application using Scala instead of Java.

Below is an example of a Mentawai action coded in Scala:

Compile this Scala class with the following command line:

This will create a file HelloScala.class inside the org\mentablank\action directory. Now you can use this class as any other Java class. Just remember to put the scala-library.jar inside the your WEB-INF/lib directory.

Let's use the javap program, that comes with Scala, to inspect our Scala class from the point-of-view of a Java program:

This will give you some hints about the Java class, but nothing can be better than a decompilation using JAD (Java Decompiler):