7) Add the directory location of the Scala 2.6.0 final distribution to the nbproject/project.properties file using the property name "scala-2.6.0-final". (This is the directory location that contains the directories "bin" and "share".)

8) Add the scala library jar "${scala-2.6.0-final}/share/scala/lib/scala-library.jar" to the list of compile libraries.

9) Add the following jars in the Jersey 0.3 distribution to the list of compile libraries: lib/jersey.jar, lib/persistence-api-1.0.jar, lib/jsr311-api.jar.

10) Deploy.

11) Goto the URL:

http://localhost:8080/ScalaWebApplication/1

... and hopefully you will see some HTML.

Notice that there is no special configuration of Scala and this should work with Glassfish V2 and V3. All that is required is correct configuration of the web.xml with the Servlet Jersey uses to dispatch HTTP requests and the initialization parameter "webresourceclass", which points to the compiled Java class of WebResources.scala.

Obviously this whole process could be better improved with some built in support for compiling Scala source files in NetBeans.