Em Mon, 15 Dec 2008 18:54:40 -0300, mraible <m...@raibledesigns.com> escreveu:

I want to load pages from multiple root packages. Is it possible to have more than one root package specified for tapestry.app-package? I tried a comma
separated value, but it doesn't seem to work.

No, you can't. But you can add more modules (each one with its pages, components, mixins and base packages).

To build a module, follow this steps. The examples are taken from the Tapestry CRUD package (http://www.arsmachina.com.br/project/tapestrycrud)

1) Create a class and add this method to it. I'll call it TapestryCrudModule:

public static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration) {

        String prefix = "crud";
        String rootPackage = "br.com.arsmachina.tapestrycrud";
        configuration.add(new LibraryMapping(prefix, rootPackage));

}

2) Add it to your application through Tapestry IoC. There are two options, and you can use both if you want:

1. In your AppModule, add the @SubModule annotation:

@SubModule({TapestryCrudModule.class, AnyOtherModuleClass.class})
public class AppModule {
        ...
}

2. Package your classes inside a JAR file and add this line to the MANIFEST.MF file:

Tapestry-Module-Classes: br.com.arsmachina.tapestrycrud.ioc.TapestryCrudModule

This option has a very good advantage: you don't have to configure your module: it is loaded automatically by Tapestry-IoC. Just include the package JAR in the classpath and that's all. :)

More information here (http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html) and here (http://tapestry.apache.org/tapestry5/tapestry-ioc/autoload.html).

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to