UI Tutorial - Dynamic Pages

Todd Wright twright at bbn.com
Thu Dec 13 13:07:12 EST 2007


Morgan Duchène wrote:
> Hi again,
> I have had a look at FileServlet and the embedded Tomcat web server.
> It seems like the jsp servlet is not available for dynamic pages.

Right.  From Tomcat's point of view there's only one servlet for the entire 
JVM.  This Cougaar "hook" servlet maintains a registry of the Cougaar-internal 
plugin servlets.

Cougaar is loosely integrated with Tomcat, to allow for alternate servlet 
engine implementations.

You can statically compile a JSP to a Java servlet and load that servlet in 
Cougaar.  There's an example attached to the end of:
   http://bugs.cougaar.org/show_bug.cgi?id=1092#c3
Tomcat automates this JSP-to-JavaClass compilation and periodically checks the 
JSP file timestamp; I can imagine an equivalent Cougaar servlet wrapper, but 
that hasn't been implemented.

> On the
> other hand, it's not realistic in a real project to have complex html 
> pages with ajax included into servlets to deliver them.

Maybe.  The static files could be served through the FileServlet.

At one extreme we could show how to integrate a full-fledged 
Model-View-Controller web toolkit (e.g. Tapestry or Struts) on top of Cougaar 
servlets.  This would likely be a lot of work.

> So I need a
> suggestion for dynamic html pages in the tutorial?

My original thought was a trivial DHTML + AJAX page, something like a "hello 
world" application:
   http://www.dynamicajax.com/fr/AJAX_Hello_World-.html

For example, the servlet (with no URL parameters) would write an HTML page with 
a table and a submit button.  The button would send an AJAX request.  The same 
servlet (with a special URL parameter or some other flag) would respond with 
JSON-formatted table data, e.g. data about what's on the blackboard.  The 
browser-side AJAX code parses the response and fills in the HTML table.

Todd

> Thanks,
> Morgan
> 
> _______________________________________________
> Cougaar-developers mailing list
> Cougaar-developers at cougaar.org
> http://cougaar.org/mailman/listinfo/cougaar-developers
> 



More information about the Cougaar-developers mailing list