1) Here's the code of the first service

public final class BasicModule
{
   ...
/*
 // It works!
public static void contributeHttpServletRequestHandler(OrderedConfiguration<HttpServletRequestFilter> configuration,
     @Symbol(BasicModule.APPLICATION_ENCODING)
     String requestEncoding)
 {
configuration.add("RequestEncoding", new RequestEncodingFilter(requestEncoding));
 }
*/

 // Doesn't work...
public static void contributeMasterDispatcher(OrderedConfiguration<HttpServletRequestFilter> configuration,
     @Symbol(BasicModule.APPLICATION_ENCODING)
     String requestEncoding)
 {
configuration.add("RequestEncoding", new RequestEncodingFilter(requestEncoding));
 }
   ...
}


2) Here's the code of the second service

public class SecurityModule
{
   ...

 public static void bind(ServiceBinder binder)
 {
binder.bind(Dispatcher.class, SecurityDispatcher.class).withId("SecurityDispatcher");
 }

public void contributeSecurityDispatcher(Configuration<String> unsecurePaths)
 {
   unsecurePaths.add("/");
   unsecurePaths.add("Start");
   unsecurePaths.add("assets");
 }

public void contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration,
     @InjectService("SecurityDispatcher")
     Dispatcher securityDispatcher)
 {
   configuration.add("SecurityDispatcher", securityDispatcher, "before:*");
 }
   ...
}

3) My AppModule

@SubModule({
 BasicModule.class,
 SecurityModule.class
})
public class AppModule
{
public void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
 {
   configuration.add(BasicModule.APPLICATION_ENCODING, "utf-8");
 }
}


Only the dispather with  "before:*"  is called.
I´m running with JBoss 4.2.0-GA.

Howard Lewis Ship wrote:
Going to need to see the code for this.

On 7/6/07, Siddhartha Argollo <[EMAIL PROTECTED]> wrote:
Hi all,

I have two submodules, both used by AppModule.

In the first module, I contribute with a "MyFirstDispatcher" to
MasterDispatcher and the constraint "before:*". In the second module, I
contribute with "MySecondDispatcher" and the constraint
"after:MyFirstDispatcher". Although both contributions are correctly
done, only MyFirstDispatcher.dispatch is called by the application.
The thing is, if I switch the constraints, again only
MySecondDispatcher.dispatch is called. If I don't use the constraints,
neither service is called.

I'm returning false in the dispatch method of both services. Am I
forgetting anything?
What I'm trying to do is wrong in anyway?

I solved my problem contributing to RequestHandler with one of the
services and leaving the other one with the constraint "before:*", still
contributing to MasterDispatcher (without this constraint, it doesn't
work). This way, both dispatches are called by the framework.

Thanks,

Siddhartha Argollo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Siddhartha Argollo
Técnico Judiciário
TRE-BA
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to