• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.el.ELContext cannot be resolved error when adding FaceletContext jsf maven built  RSS feed

 
Jonnathan Ladino
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public String save() throws BusinessException {
this.success="Cambios guardados correctamente";
if(this.selectedRoles.size()==0){
addMessage("",FacesMessage.SEVERITY_ERROR);
getFacesContext().getApplication().evaluateExpressionGet(
getFacesContext().getApplication().evaluateExpressionGet(
getFacesContext(), "Se debe seleccionar almenos un rol", String.class), FacesMessage.SEVERITY_ERROR );

return"form";
}



what is red is the error
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Jonnathon!

Keep things simple.

I usually create a class named "JSFUtils" in my webapps. Here's an example of 2 methods in it:


Armed with this service class and methods, my backing beans can do stuff like this:



Note that this keeps me from having to code logic using JSF internals directly in my backing bean. That makes the bean more immune to changes in later versions of JSF as well as making it easier to do offline unit-testing.

¬°AND it's a lot simpler to code and understand!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!