On 13-10-27 12:55 PM, Eric B wrote:
On 13-10-27 4:06 AM, Mick Semb Wever wrote:

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

Does the definition this request is using have in your tiles.xml the
"myopts" list attribute defined?


     <put-list-attribute name="myopts">
         <add-attribute value="{1}"/>
         <add-attribute value="common"/>
     </put-list-attribute>



  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.


Odd. Can you post your tiles.xml.
(Or post a reproducible test-case to the issue).
This does sounds like something rather trivial to fix, but i need a
little more information still.


Here is my tiles.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 
3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd";>
<tiles-definitions>

<definition name="REGEXP:([^.]+)" 
template="/WEB-INF/views/tiles/layouts/default.jsp">
     <put-attribute name="meta" 
value="/WEB-INF/views/tiles/${options[defaults]}/meta.jsp"/>
     <put-attribute name="head" 
value="/WEB-INF/views/tiles/${options[defaults]}/head.jsp"/>
     <put-attribute name="header" 
value="/WEB-INF/views/tiles/${options[defaults]}/header.jsp"/>
     <put-attribute name="menu" 
value="/WEB-INF/views/tiles/${options[defaults]}/menu.jsp"/>
     <put-attribute name="body" 
value="/WEB-INF/views/tiles/${options[defaults]}/body.jsp"/>
     <put-attribute name="footer" 
value="/WEB-INF/views/tiles/${options[defaults]}/footer.jsp"/>

     <put-list-attribute name="defaults">
         <add-attribute value="{1}"/>
         <add-attribute value="common"/>
     </put-list-attribute>
</definition>
</tiles-definitions>


P.S. I've tried different names for my attribute list (ie: myopts, my_opts, defaults, etc) in the hope that it was a naming convention problem (although couldn't see how/why that would an issue) but the error message is always the same (specifying the different list name, of course). In this particular example, the exception thrown was:


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



Reply via email to