Fluent interface pattern (setter returning 'this') conflicts with JSF


I am developing a GUI with JSF to generate DDL for multiple SGBDs.

The problem is that using setter methods returning types, I have some conflicts with EL.

Explaining by example:

When using a simple JSF tag for text input:

<h:inputText value="#{myBackingBean.columnConfig.value}" />

I get below grave warning from EL/JSF validations that doesn’t let me submit that form:

Property ‘value’ not writable on type java.lang.String

Looking ELResolver docs, we have:

 but the specified variable or property is not writable.

Actually I didn’t find that ColumnConfig.value isn’t writable. Am I confusing something or I got the right path investigating this?

NOTE: I already found a workaround, but it wasn’t a clean approach :expressionless:

With your workaround, did it still look like the problem was caused by the setters returning “this” ?


That is disappointing it causes problems. I don’t think I’ll change the interface at this point because it makes other interactions much easier and would be a breaking API change for people.

If there is enough problems from others I may look for alternative solutions.


Unfortunately, yes.