Hosted by SourceForge

Valid XHTML 1.0!

EuroLinux Alliance

On this page we will help you learn how to start working with Smile. This "Getting Started"-page will grow over time and, dare I say it, may eventually turn into a complete user manual!

What you need before we begin:

  • Java JRE 1.4 or higher
  • Tomcat 4.x or other Servlet 2.3 compliant container
  • JSF-API (you can copy the jsf-api.jar from the "JavaServerTM Faces v1.0 Reference Implementation Beta" at
  • log4j-1.2.8 (packaged with smile distribution)
  • copy the jsf-api.jar file to the WEB_INF/lib directory of your web application.
  • copy the smile0.3.x.jar file to the WEB_INF/lib directory of your web application.
  • copy the log4j-1.2.8.jar file to the WEB_INF/lib directory of your web application.
  • configure your web.xml file, here's an example:
        Smile, the JavaServer Faces open-source implementation.
        Development web-app for smile.

        <description>The package where the screen descriptors are located.</description>
        <description>The postfix to append to descriptor class names.</description>
        <description>state saving option. One of client,server</description>




The web.xml contains two Smile specific context parameters:

  1. "": This parameter must point to the package where you will keep your descriptor files.
  2. "": This parameter contains the postfix that will be appended to the treeId in order to find the correct descriptor file(leave this param-value blank if you don't want a postfix).

Now you can start creating your pages, pages are defined as pojos(plain old java objects) in Smile. For Example to create your first hello world page, create a Java file like this:

public class HelloWorld extends UIScreen {
    private UIColumnLayout layout;
    private UIOutput label;
    public HelloWorld() {
        setTitle("Hello World Example...");

        layout = new UIColumnLayout(1,1);

        label = new UIOutput();
        label.setValue("Hello World");

Copy the application to Tomcat and navigate to http://localhost:8080/<app-name>/faces/HelloWorld (replace app-name with the name of your web application).

If all went well, you should see a blank page with the text: Hello World.