I would like to show the element of the HashMap in a xhtml page (with jsf):
<h:selectOneMenu id="elt" value="#{mgbean.elt}">
<c:forEach var="entry" items="#{mgbean.map}">
<f:selectItem itemValue="#{entry.key}" itemLabel="#{entry.value}" escape="false" />
</c:forEach>
</h:selectOneMenu>
the Map is the following:
map= new LinkedHashMap<String, String>();
map.put("1", ">=20");
map.put("2","<20");
I got this error :
PM org.apache.myfaces.lifecycle.RenderResponseExecutor execute WARNING: There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered. These unhandled FacesMessages are: - selectionForm:elt: Validation Error: Value is not valid
i tried to add the following lines but the same error showed
<?xml version="1.0" encoding="UTF-8"?>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head>
how can i fix this error.
UPDATE:
public String elt;
with getter and setter.
public Map<String, String> map;
map= new LinkedHashMap<String, String>();
map.put("1", ">=20");
map.put("2", "<20");