JSF EL #{not null bean.property} Parse exception

Denny1989

Aktives Mitglied
Halllo.
ich versuche in einer jsf anwendung folgendes zun:

Java:
 <h:outputText rendered="#{not null myBeanPM.name}" value="${myBeanPM.name}"> </h:outputText>

das Bean dazu sieht so aus in etwa:
Java:
@Named
@SessionScoped
public class MyBeanPM implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@EJB
	private DataService service;
	
	
	public String getName(){
		return "Name";
	}
	
}
das da nie null kommt ist mir klar, ist auch nur zu testzwecken weil ich seit geschlagenen 2 h am verzweilfen bin.
jedenfalls bekomme ich folgende Fehlermeldung beim aufruf der seite:

Java:
javax.faces.view.facelets.TagAttributeException: /index.xhtml @11,91 rendered="#{not null myBeanPM.name}" Error Parsing: #{not null myBeanPM.name}

root cause

javax.el.ELException: Error Parsing: #{not null myBeanPM.name}

root cause

com.sun.el.parser.ParseException: Encountered "myBeanPM" at line 1, column 12.
Was expecting one of:
    "}" ...
    "." ...
    "[" ...
    ">" ...
    "gt" ...
    "<" ...
    "lt" ...
    ">=" ...
    "ge" ...
    "<=" ...
    "le" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "&&" ...
    "and" ...
    "||" ...
    "or" ...
    "*" ...
    "+" ...
    "-" ...
    "?" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...

ich benutze glassfish 3.1.1 als AppServer .

Hat jemand eine Idee? es sollte doch möglich sein so auf null zu prüfen oder?
 
Hi,

Versuch mal not empty anstatt not null
Java:
 <h:outputText rendered="#{not empty myBeanPM.name}" value="${myBeanPM.name}"> </h:outputText>

Gruß
 

Zurück
Oben