问题
Does anybody know if passing objects as parameter from one composite component to another child composite component is thread-save?
I have a composite component A that uses another composite component A' as child and passes an object as parameter cc.attrs.parameter to A'.
A is used twice in the same form:
Component A:
<cc:interface>
<cc:attribute name="value"/>
</cc:interface>
<cc:implementation>
<cdef:myChildComponent value="${cc.attrs.value}"/>
<!-- Show data from value -->
</cc:implementation>
Component A' (myChildComponent):
<cc:interface>
<cc:attribute name="value"/>
</cc:interface>
<cc:implementation>
<h:commandLink action="${cc.attrs.value.load}">
Reload Data
</h:commandLink>
</cc:implementation>
A' reloads data from the bean if you click on a button via Ajax. But it happens, that the Button in one A reloads the Data for the second A... (and I'm using id's and that stuff to separate both A)
If I copy the code from A' directly in A, so that no child composite component is used. this effect does not appear.
It looks like parameter-passing between composite components is not thread-safe... Strange thing...
来源:https://stackoverflow.com/questions/8877418/composite-component-with-child-composite-component-not-thread-safe