Showing posts with label JSF. Show all posts
Showing posts with label JSF. Show all posts

How to remove JSP EL error

Posted on by Kim

If getting this error:

com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl. If not using JSP or the EL RI, make sure the context initialization parameter, com.sun.faces.expressionFactory, is properly set.

Running eclipse and a server:
just go to 'Java EE Module Dependencies' and remove:

Building ear or war file:
make sure the following does not come with:

- servlet-api-??.jar
- jsp-api-??.jar

and let it be up to the server to provide the rigth versions.

Easy sort a list of SelectItem's

Posted on by Kim

Easy way to sort a Collection for e.g. dropdown.

Collections.sort(<Collection of SecletItem's>, new SecletItemComparator());

// Inner class
public class SecletItemComparator implements Comparator {
@Override
public int compare(SelectItem s1, SelectItem s2) {
return s1.getLabel().compareTo(s2.getLabel());
}
}