private void checkELSyntax ( String el , ELContext context ) { int pos = el . indexOf ( ' ' ) ; if ( pos < 0 ) { throw new FacesException ( "The EL expression doesn't contain a method call: " + el ) ; } int end = el . indexOf ( ' ' ) ; if ( end < 0 ) end = el . length ( ) ; if ( el . indexOf ( ' ' ) >= 0 ) end = Math . min ( end , el . indexOf ( ' ' ) ) ; while ( pos < end ) { String object = el . substring ( 0 , pos ) ; ValueExpression vex = evalAsValueExpression ( "#{" + object + "}" ) ; vex . getValue ( context ) ; Object result = vex . getValue ( context ) ; if ( result == null ) { System . out . println ( "Please check your EL expression - intermediate term " + object + " is null" ) ; } pos = el . indexOf ( ' ' , pos + 1 ) ; if ( pos < 0 ) break ; } }
Evaluate the expression syntax