0

I am having an functionality through which I am displaying the properties of a document on JSF. The properties are coming through a map and I am iterating it over the JSF as follows:

<af:iterator var="list" value="#{MainContentBean.documentProperties}" id="i1">
    <af:inputText label="#{list.key}" id="it1"editable="always" value="list.value">                
</af:iterator>

This is working fine till I want to use it only for the display purpose, but if I want to make it up datatable, i.e the user can change the values of the input text box it's not working. The input text box is always displayed in read only mode if the setters and getters are not present. The values I am getting in map is uncertain, so in this situation, how can I generate setters and getters for each property value at runtime? Is this possible to do that?

4

1 回答 1

1

是的,可以使用 cglib。看看“使用 cglib 添加 setter/getter 以与 RoR 竞争......愚蠢的想法?来自 Crazy Bob 的输入”

另外,看看这个建议使用 ASM的答案

于 2012-08-29T09:53:57.727 回答