the application throws an error Property not writable Illegal Syntax for Set Operation
Your EL expression #{}
is invalid. It must evaluate as a value expression, not as a method expression. It isn't possible to perform a setter method call on the given method expression, while that's required when the JSF form is to be submitted. You need to remove the is
prefix and those parentheses to make it a valid value expression.
<h:inputHidden id="onlyCaseSensitive" value="#{testBean.pageAllowed}"/>
This requires a public boolean isPageAllowed()
getter method and a public void setPageAllowed(boolean pageAllowed)
setter method.
If you actually only need to use the JSF managed bean property as a JavaScript variable, then you shouldn't be rendering it as a hidden input at all, but just let JSF render a fullworthy JavaScript variable without the need to mess with hidden inputs and HTML DOM traversal.
E.g.
<script>
var onlyCaseSensitive = #{testBean.pageAllowed};
</script>
This will end up in the JSF generated HTML output like as follows (rightclick page and do View Source to see it):
<script>
var onlyCaseSensitive = true;
</script>