I'm creating something like DocumentScriptBuilder for inserting stylesheets, much like DocumentScriptBuilderImpl does for javascripts. I have this method in my app module, inspired by the method in TapestryModule:

public void contributePageRenderInitializer(OrderedConfiguration<PageRenderCommand> configuration) { configuration.add("DocumentStyleBuilder", new PageRenderCommand() { public void cleanup(Environment environment) { DocumentStyleBuilder builder = environment.pop(DocumentStyleBuilder.class);
               Document doc = environment.peek(Document.class);
               builder.updateDocument(doc);
           }
public void setup(Environment environment) { environment.push(DocumentStyleBuilder.class, new DocumentStyleBuilderImpl());
           }
}, "before:PageRenderSupport");
   }

When I try to inject this via @Environmental, a RuntimeException is thrown with this message: "No object of type xxx.services.DocumentStyleBuilder is available from the Environment. Available types are ."

With logging I've verified that this is thrown _before_ my contribution is called, suggesting that the page using the @Environmental (my Start page) is initialized before my contribution is called. I tried using "before:PageRenderSupport" as a constraint to no avail. How can I get my object into the environment, since mimicking what's in TapestryModule doesn't seem to work?

thanks!

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

Reply via email to