Hello,
I am new to
JSF. I have set up few things in ArrayList in my contextListener as like below
ServletContext context=event.getServletContext();
List list=new ArrayList();
list1.add("Honda");
list1.add("Mazda");
list1.add("eClipse");
context.setAttribute("carList", list)
I just wanted to display the list in my JSF page, I wrote the below statements in my JSF page
<h:selectOneMenu value="{com.carSelection}">
<c:forEach var="car" items="${applicationScope.carList}" >
<f:selectItem itemLabel="${car}"/>
</c:forEach>
</h:selectOneMenu>
I am getting the below exception
org.apache.jasper.JasperException: /pages/protected/cmt/index.jsp(23,2) According to TLD or attribute directive in tag file, attribute itemLabel does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1124)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:819)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:838)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator
Could some one help to solve this error (Or) How should I display from my applicationScope list into MenuItems ?