Index: stripes/src/net/sourceforge/stripes/ajax/JavaScriptBuilder.java
===================================================================
--- stripes/src/net/sourceforge/stripes/ajax/JavaScriptBuilder.java	(revision 1921)
+++ stripes/src/net/sourceforge/stripes/ajax/JavaScriptBuilder.java	(working copy)
@@ -82,6 +82,9 @@
 
     /** Holds the (potentially empty) set of user classes that should be skipped over. */
     private Set<Class<?>> excludeClasses;
+    
+    /** Holds the JS variable name to which the built JS value will be assigned. */
+    private String varName;
 
     /**
      * Constructs a new JavaScriptBuilder to build JS for the root object supplied.
@@ -102,6 +105,21 @@
     }
 
     /**
+     * Constructs a new JavaScriptBuilder to build JS for the root object supplied.  
+     * This constructor will assign the JS graph to the given variable name.
+     *
+     * @param varName The variable name to which the JS graph will be assigned
+     * @param root The root object from which to being translation into JavaScript
+     * @param userClassesToExclude Zero or more classes to be excluded from translation. Any class
+     *        equal to, or extending,
+     */
+   public JavaScriptBuilder(String varName, Object root, Class<?>...userClassesToExclude ) {
+ 	   this(root, userClassesToExclude);
+ 	   
+ 	   this.varName = varName;
+    }
+
+    /**
      * Causes the JavaScriptBuilder to navigate the properties of the supplied object and
      * convert them to JavaScript.
      *
@@ -150,6 +168,9 @@
                 writer.append(";\n");
             }
 
+            if (varName != null)
+         	   writer.append("var ").append(varName).append(" = " );
+            
             writer.append(rootName).append(";\n");
         }
         catch (Exception e) {
Index: stripes/src/net/sourceforge/stripes/ajax/JavaScriptResolution.java
===================================================================
--- stripes/src/net/sourceforge/stripes/ajax/JavaScriptResolution.java	(revision 1921)
+++ stripes/src/net/sourceforge/stripes/ajax/JavaScriptResolution.java	(working copy)
@@ -43,6 +43,19 @@
     }
 
     /**
+     * Constructs a new JavaScriptResolution that will convert the supplied object to JavaScript 
+     * and assign that value to the given variable name.
+     *
+     * @param varName The variable name to which the JS graph will be assigned.
+     * @param rootObject an Object of any type supported by {@link JavaScriptBuilder}. In most cases
+     *        this will either be a JavaBean, Map, Collection or Array, but may also be any one of
+     *        the basic Java types including String, Date, Number etc.
+     */
+    public JavaScriptResolution(String varName, Object rootObject, Class<?>... userTypesExcluded) {
+        this.builder = new JavaScriptBuilder(varName, rootObject, userTypesExcluded);
+    }
+
+    /**
      * Converts the object passed in to JavaScript and streams it back to the client.
      */
     public void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
