Listing 1: Mabon Servlet Configuration

<servlet>
<servlet-name>Mabon Servlet</servlet-name>
<servlet-class>
net.java.dev.mabon.webapp.FacesLifecycleServlet
</servlet-class>
<init-param>
<param-name>javax.faces.LIFECYCLE_ID</param-name>
<param-value>net.java.dev.mabon</param-value>
</init-param>
</servlet>
...
<servlet-mapping>
<servlet-name>Mabon Servlet</servlet-name>
<url-pattern>/mabon/*</url-pattern>
</servlet-mapping>


Listing 2: The mabon.js Library

dojo.provide("net.java.dev.mabon");

 /**
  * @param  kvparams (map)
  *         {
  *           url       the destination URL
  *           args      the arguments array
  *           callback  the result callback, signature (result)
  *         }
  */
 net.java.dev.mabon.send = function (
   kvparams)
 {
   var params = new Array();
   for (var i=0; i < kvparams.args.length; i++)
   {
     var arg = kvparams.args[i];
     if (typeof(arg) == "string") 
       params.push("'" + arg + "'");
     else
       params.push(arg);
   }
   
   var content = {args:'[' + params.join(',') + ']'};

   dojo.io.bind(
   {
     url: kvparams.url ,
     method: 'get',
     content: content,
     mimetype: "text/javascript",
     load: function(type, data, evt) { kvparams.callback(eval(data)); },
	 error: function(type, data, evt) { alert
	 ('Oops! The server returned an error, please try again.'); }
   });
 }