Java 8 default interface methods not recognized as managed bean properties in EL

后端 未结 2 1631
暗喜
暗喜 2021-01-18 11:13

I am trying to setup my own JSF tag libary. So I created a composite component with an backing interfaces as a blueprint to build a backing bean for this component.

相关标签:
2条回答
  • 2021-01-18 11:45

    Working with Apache EL this works by calling the default method by its full name. Try to use it this way in your code:

    #{login.getUsernameWatermark()}
    
    0 讨论(0)
  • 2021-01-18 11:46

    The problem is likely caused by EL relying on reflection to find the appropriate accessor methods, but doing it in a way that fails for default methods.

    Consider implementing a custom ELResolver similar to what they did here.

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