I have spent a lot of time on this today, trying to debug & understand how the OptionsRenderer is working, but failing at it. I don't know the internals of Tiles too much, so I'm a bit at a loss of understanding all the contexts that are being pushed onto a stack and looked up/popped off.

Essentially, the error I get when trying to use the OptionsRenderer is:

java.lang.IllegalStateException: A matching list-attribute name="my_opts" must be defined.

I tried to follow as best as possible the instructions on the http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/4/ site, but the instructions seem rather old and obsolete and some classes referenced no longer exist in Spring 3.2.4 and/or are configured differently.

From what I can tell, it would appear that the context that the OptionsRenderer is receiving is not correct; the attributes and cascadedAttributes are both null, even though they should be set. However, I have been unable to trace why this is happening.

I also note that this is an ongoing problem for several people already, but no solution(s) have been proposed. Ex: http://dhruvgairola.blogspot.de/2013/03/spring-mvc-with-apache-tiles-3.html, https://issues.apache.org/jira/browse/TILES-569, etc.

I have tried to instantiate the OptionsRenderer as follows:

public class TilesContainerFactory extends CompleteAutoloadTilesContainerFactory {

        @Override
protected Renderer createTemplateAttributeRenderer(BasicRendererFactory rendererFactory, ApplicationContext applicationContext, TilesContainer container,
                        AttributeEvaluatorFactory attributeEvaluatorFactory) {
Renderer renderer = super.createTemplateAttributeRenderer(rendererFactory, applicationContext, container, attributeEvaluatorFactory);
                
                // create an Options Renderer
OptionsRenderer optionsRenderer = new OptionsRenderer(applicationContext, renderer);
                return optionsRenderer;

        }

}


Can someone please explain if/how to get this class to work?

Thanks,

Eric

Reply via email to