With EL, is it possible to do field access on beans rather than getters/setters?

后端 未结 2 1894
野的像风
野的像风 2020-12-09 22:37

EDIT

Take this answer with a grain of salt. Much has changed since I asked this question years ago. I recommend now using Lombok instead of my EL solution. Leaving

相关标签:
2条回答
  • 2020-12-09 23:03

    You can use @Getter/@Setter annotations from Project Lombok if you don't want to write/generate getter and setter method(s) on your Java Bean.

    0 讨论(0)
  • 2020-12-09 23:09

    Yes. Jsf is very extensible, pretty much everything can be extended or replaced.

    A great example of custom resolvers is here

    The guy was using it to populate dropdown lists from database queries. I'm certain you could use similar techniques to resolve based on public fields rather than public get/set methods.

    0 讨论(0)
提交回复
热议问题