You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ilya Zverev (JIRA)" <ta...@jakarta.apache.org> on 2007/02/05 17:56:05 UTC

[jira] Created: (TAPESTRY-1255) Hivemind configuration injection always produces a List

Hivemind configuration injection always produces a List
-------------------------------------------------------

                 Key: TAPESTRY-1255
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1255
             Project: Tapestry
          Issue Type: Bug
          Components: Core
    Affects Versions: 4.0.2
            Reporter: Ilya Zverev


Suppose we need to create <configuration> in hivemodule.xml which holds a simple map. As the documentation states, all we need is to specify key-attribute parameter and write a simple translating rule.

Then in .jwc we write something like this:

<inject property="map" object="configuration:somemodule.ConfigMap"/>

<component id="test" type="Insert">
    <binding name="value" value="map.get('someKey')"/>
</component>

...and happily receive an OGNLException informing us that 'someKey' can hardly be converted into a number.

That's because injected configurations is always injected as List even when the magic parameter key-attribute is specified. With abstract property accessor of type Map we receive another exception requiring to change method return parameter to something like List.

The source of this problem lies somewhere in InjectValueTranslatorImpl that passes Object.class as the parameter type to ObjectTranslator. I suppose there must be not Object.class but a real property class received from EnhancementWorker.

For now I've created a special translation prefix "configuration-map" that returns Map if required parameter type can be assigned from Map, but I'm looking forward to bugfix :)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org