Scala Pages

Download Current version: 0.1.2 (2nd release, Scala 2.8.0) Download Manual (PDF)

Archive

Scala Pages 0.1.1 (Scala 2.7.7)

What are Scala Pages?

Scala Pages (SCP) is a lightweight web framework developed in the Scala language. It is intended for developing Scala web applications; it is released under the Apache 2 license. SCP provides an API that is familiar to Java programmers. It is built on and closely aligned to the Servlet API. It can be learned quickly by anyone familiar with Java web development. The SCP Scala web framework is build around a text-oriented template engine. Dynamic web pages are either generated from templates or from Scala code. Templates can be HTML-templates, XML-templates or any other text format, such as CSV, JSON, etc. Because SCP neither uses DOM nor SAX parsing, memory and CPU requirements are moderate. SCP makes use of XML processing instructions instead of custom tags.

Target Audience

The Scala Pages web framework is likely to appeal to web programmers who come from a Java background and want to program web applications in Scala. The emphasis is on OOP rather than functional programming.

Characteristics And Features

  • Adheres to model-view-controller paradigm
  • Text-based template engine
  • Simple syntax: $variable and <?scp-instruction?>
  • Encoding/content detection, able to handle international text encodings
  • Snippets instead of custom tags
  • URL Rewriting

Code Sample

The infamous "Hello World" application is trivial to implement:

import scp.core._ 

class Hello extends RequestHandler with XmlResponse {
  val title = "Welcome to SCP"
  val name = "World" 

  def xml =
  <html>
    <head>
      <title>{title}</title>
    </head>
    <body>
      <h1>Hello, {name}!</h1>
    </body>
  </html> 

}