[LWN Logo]

Date: Mon, 26 Apr 1999 13:17:49 -0400
From: Justin Wells <reader@semiotek.com>
To: java-linux@java.blackdown.org
Subject: [ANN] WebMacro Servlet Framework 0.85.2



WebMacro Servlet Framework 
==========================


 Announcing WebMacro 0.85.2:

     http://www.webmacro.org/

 WebMacro is a Java servlet development framework, including a
 template engine plus extensible component model. It uses Java
 introspection to make ordinary objects in your servlet accessible
 as variables in a simple, concise template script. 

 WebMacro is free under the GPL, with alternate licensing available
 for proprietary commercial use. See the website for details.


Is WebMacro Useful?
-------------------

 Here's what people on the WebMacro list (webmacro-request@webmacro.org)
 have to say about it:

     "FYI Justin, I'm now running over 10 web applications (in
     production) using WebMacro. It runs like a scalded dog, and
     makes it easy for the designers to produce layout, so I can
     concentrate on code.  Keep up the good work."
         -Jason Hill

     "BTW, I really like your philosophy, and the code looks nicely
     done. I was looking at the latest JSP incarnation and my
     stomach was churning. The simple $x.y.z and # syntax you use
     is perfect."
         -Ari Halberstadt

     "so much of webmacro is what I had planned to write on my own, only 
     better laid out"
         -Robert Hentosh

     "Finally, thanks for a great product that saves you from the
     problem with writing html-code in your Java sourcefiles!"
         -Jonsson Fredrik

     "I found Webmacro last Friday just as I was completing a suite
     of servlets.  Fetched the mailing list archives (and actually
     read them <g>) and totally loved the concept and the direction
     that webmacro is heading.  I've been rewriting my set of
     servlets and gleefully tearing every shred of HTML code out
     of my java <*very* big grin>."
         -William Featherston

     "Ease of use plus power makes killer apps."
         -Simon Arthur


What's WebMacro for?
--------------------

 The WebMacro philosophy is: 

     "Things that you don't care about should get out of your face."

 Programmers should not have their code cluttered up with HTML and 
 stylesheet junk. Web page designers should not have to put up with 
 complex and scary looking program code. 
 
 WebMacro lets programmers get back to programming--in an ordinary,
 powerful programming language (Java); while letting page designers 
 work with plain old HTML and a simple script language.

 Or, to put it another way, WebMacro brings a Model/View/Controller 
 design to servlet programming: Your servlet (controller) processes 
 input and interacts with back-end business objects (model), handing
 data to the template (view)--which turns it into HTML.
 
 WebMacro does the hard work of analyzing your objects to determine 
 how they can be accessed in the template; WebMacro also provides a 
 simple, concise script language for use in HTML templates; plus 
 WebMacro provides an extensible, customizable component model to
 manage your back-end beans and other business objects.


What Changed?
------------

   - 0.85.2 fixed several bugs: macros in lists weren't evaluated, 
     #foreach would not use list initializer syntax; #if evaluated
     its condition twice, $Broker variable in templates was failing.
   - 0.85.1 fixed minor bugs: extraneous errors in log cleaned up,
     introspector now uses iterator() methods properly, docs updated.
   - 0.85 added reloadable templates, cleaned up the WMServlet API, 
     added template paths, made it easier to compile under Java 2, 
     and fixed several nasty bugs.
   - 0.80 added method calls, generic templates, template parameters, 
     list initializer syntax, comments, bug fixes, and a few other things;
     0.80.1 fixes a minor bug in 0.80 (name of error template).
   - 0.75 added the component model, full fledged introspection
     0.75.3 fixes all bugs reported as of January 22 1998
   - 0.70 more back end services, better design, and fewer bugs
   - 0.60 script language mostly in place, minimal introspection, many bugs
   - 0.30 WebMacro said "Hello, World!" in a secret experiment

 WebMacro pre-1.0 is beta software. Despite that, recent versions are
 increasingly stable. A few features remain to be implemented in 
 order to get to 1.0.


What are the Advantages?
------------------------

   * Clean. Write crisp, clear code free of HTML and presentation issues.

   * Simple. Put intuitive template scripts inside ordinary HTML.

   * Powerful. Script variables analyze and access ordinary Java objects.
 
   * Independent. Change templates without touching your servlet.
  
   * Extensible. Component model lets you to extend WebMacro itself.

   * Fast. WebMacro caches parsed templates for high-performance use.

   * Free. WebMacro is available under the GPL.
  

I Need an Example!
------------------

 The WebMacro introspector analyzes your objects, and figures out how
 to extract sub-objects as variables in the template script. All you
 do as a programmer is provide ordinary Java objects using ordinary
 Java code. Notice how clean the code is without all the HTML.

 This Java servlet code:

     // subclass WMServlet and implement handle:

     Template handle(WebContext context) {

        // populate the context with ordinary objects
        Store curStore = ...;
        context.put("Store", curStore);

        // pick a template
        String tmplName = ...;
        Template tmpl = getTemplate(tmplName);
        return tmpl;
     }

 supplies the data for this template:

     <h1>Products for $Store.Name as of $Store.Date</h1>

     <table><tr><td>What We Have</td> <td>How Many Left</td></tr> 

     #foreach $product in $Store.Products {
       <tr><td>$product.Name costs \$$product.Price</td>

       #if ($product.isAvailable()) {
         <td>There are $product.Count in stock</td>
       } #else {
         <td>Sorry, out of stock.</td>
       }

       </tr>
     }
     </table> 
     
 From the programmers point of view, Store, Product, etc., are 
 just regular objects. No work is required to open them up to the
 introspector--just toss them in a WebMacro context and it will
 work out what properties and sub-objects are available.

 See the website to learn more.


Where is It?
------------

  website: http://www.webmacro.org/ 

  list:    webmacro-request@webmacro.org

  me:      justin@webmacro.org


 Everyone is encouraged to join the mailing list. Without the
 valuable contributions of Tom, Cristi, Frank, Simon, Klaasjan,
 Kyallee, Graydon, Michael, Dirk, and everyone else on the list
 who contributed ideas, code, and bugs, we wouldn't be where we
 are--Thanks!

Justin Wells / justin@webmacro.org


----------------------------------------------------------------------
To UNSUBSCRIBE, email to java-linux-request@java.blackdown.org
with a subject of "unsubscribe". Trouble? Contact listadm@java.blackdown.org