Quick Start > Step 3: JotResponseBean

Step 3: JotResponseBean

In the third step, the JOT Servlet (step 2) is configured with a JotResponseBean that provides dynamic content for the JOT Template (step 1). Here is an example JotResponseBean:

    package com.jotobjects.demo.quickstart;
    import com.jotobjects.servlet.*;

    public class QuickStartBean
        extends JotServletResponseBean
    {
      private String foo = "";

      public void setFoo(String foo)
      {
        this.foo = foo;
      }
      public String getFoo()
      {
        return foo;
      }
      public java.util.Date getNow()
      {
        return new java.util.Date();
      }
    }

An HTTP request from a client browser causes the set methods to update JOT Bean properties. In this example the setFoo() method is called. The input values are set with request parameters from the URL query string or HTML form elements.

When a servlet request is received, dynamic content is rendered with the getNow() and getFoo() methods that correspond to the JOT.Now and JOT.Foo JOT Tokens in QuickStart.html, the JOT Template from step 1.

This is a basic example. The full capabilities of JOT Template scripting and JOT Bean programming techniques are covered in the Programming Guide and demonstration servlets.

© 2008 JOT Object Technologies