ValueExpression beanExpression = expressionFactory
.createValueExpression(facesContext.getELContext(),
"#{library}", Library.class);
Library library = (Library)beanExpression.getValue(facesContext.getELContext());
for (Song song : library.getSongsList()) {
if (song.getId() == id){
return song;
}
}