I tried to create a command button with value <<.

<h:commandButton value="<<" />

However, it threw the following exception:

javax.faces.view.facelets.FaceletException: Error Parsing /test.xhtml: Error Traced[line: 42] The value of attribute "value" associated with an element type "h:commandButton" must not contain the '<' character.

How do I create such a button?

4

There are 4 best solutions below

5
On
<h:commandButton value="&#60;&#60;" />
0
On
<a4j:commandButton value="&lt;&lt;"></a4j:commandButton>
0
On
<h:commandButton value="&lt;&lt;"  action="#{myBean.action}" />
3
On

JSF provides default button compponent called h:commandButton value="<<" action="#{buttonController.action}"/>".

Here in action buttonController is the managed bean name and action is the method to call after clicking this button.