Using this expression with empty operator will Not trigger NullPointerException if object2 is null : #{empty bean.object1.object2 ? \'-\' : bean.object1.object2}
#{empty bean.object1.object2 ? \'-\' : bean.object1.object2}