Fluent Configuration

The FluentConfigurator uses a the Fluent Interface style as described by Martin Fowler.

To wire up the configuration programmatically rather than having to use dwr.xml, you'll need to:

The implementation of configure() will look something like this:

public void configure() {
   withConverterType("dog", "com.yourcompany.beans.Dog");
   withCreatorType("ejb", "com.yourcompany.dwr.creator.EJBCreator");
   withCreator("new", "ApartmentDAO")
       .addParam("scope", session)
       .addParam("class", "com.yourcompany.dao.ApartmentDAO")
       .withAuth("method", "role");
   withCreator("struts", "DogDAO")
       .addParam("clas", "com.yourcompany.dao.DogDAO")
   withConverter("dog", "*.Dog")
       .addParam("name", "value");
       .addLine("import java.util.List;")
       .addLine("import com.example.Check;")
       .addLine("Check.setLotteryResults(List<Integer> nos);");

Please see the dwr.xml configuration page for more information on how to configure creators and converters.

For more information see the JavaDoc for FluentConfigurator

DWR's fluent configurator was originally contributed by Aaron Johnson and is part of the dwr-noncla.jar.