That's the effect of JSF's safeguard against tampered/attacked requests wherein the hacker attempts to circumvent the readonly
(and disabled
) attribute by manipulating the HTML DOM and/or the HTTP request.
Instead of
<x:inputXxx ... readonly="true">
use
<x:inputXxx ... readonly="#{facesContext.currentPhaseId.ordinal eq 6}">
or
<x:inputXxx ... readonly="#{not facesContext.postback or facesContext.renderResponse}">
This makes sure that readonly
is only effective during render response phase and not during all other JSF phases. So, when JSF is about to decode the input component during the apply request values phase, it will consider readonly="false"
this way.
See also:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…