Clone wiki

slan / Home



  • HTTP-to-code url mapping
  • Bind an HTTP parameter to a code method parameter
  • Hot reload(fix the bug and hit reload)
  • Show error source code directly
  • Simple stateless MVC
  • Familiar templating engine(the language just is fantom)
  • Standalone architecture(all pod is standalone)
  • Javascript FWT suppert
  • Zero configuration
  • Build-in localization
  • Fanlet compatible(to deploy on servlet container)
  • Full-stack(ORM/Validate/Patchca...)


  • slanWeb is core web service
  • slanDemo is a web app template and demo
  • slanOrm is very simple ORM tool
  • slanUtil is some web utilitys

Quickly start

Down load and build slanWeb and slanUtil.

Run slanDemo on dubug mode:

$fan idraft -appHome file:/D:/code/Hg/slan/slanDemo/ slanDemo::RootMod

You should be able to hit http://localhost:8080/ with your browser!

Directory Structure

  -action //your app controller
  -jsfan //javascript fwt class
  -model //app model
  -boot //webRootMod and Main
  -fwt //fwt segment
  -view //template file
locale //i18n

First Action

Create a new class in action folder, like this:


   using slanWeb
   using web
   const class Hello : SlanWeblet
      Str say(Str name)
         "Hello $name"

Do not need to restart the service.

Go to http://localhost:8080/Hello/say?name=world. If everything is ok,you will see 'Hello world'

Add View

create a file 'say.html' in `view/Hello/`, like this:


   #for(Int i := 0; i < 5; i++){

and modify above action code to:

   using slanWeb
   using web
   const class Hello : SlanWeblet
      Void say(Str name)
         m->message = "Hello $name"

'm' be use to pass data from controller to view

Refresh your browser, you will see the message five times.

Work with FWT

There are two way to work with FWT.

1. Embed into HTML page

   m->compileJs = compileJs(`Hello.fwt`)

And insert a div in HTML code

  <div id='fwt-root' style='position:relative; width:400px; height:300px;'>

2. Full FWT

Add a class at appHome/fan/jsfan/. And mark it using js facet.


Yet another blog base on Slan