this 변수는 항상 정의되어 있으며 현재 평가 개체 (규정되지 않은 참조가 해결됨)를 참조한다. #root 변수는 항상 정의되고 root context 오브젝트를 참조한다. 비록 #this가 표현 컴포넌트가 평가되기떄 문에 다양할 수 있지만 #root는 항상 root를 참조한다. 아래는 어떻게 #this와 #root를 사용하는지를 보여준다.
// create an array of integersList<Integer> primes =newArrayList<Integer>();primes.addAll(Arrays.asList(2,3,5,7,11,13,17));// create parser and set variable 'primes' as the array of integersExpressionParser parser =newSpelExpressionParser();EvaluationContext context =SimpleEvaluationContext.forReadOnlyDataAccess();context.setVariable("primes", primes);// all prime numbers > 10 from the list (using selection ?{...})// evaluates to [11, 13, 17]List<Integer> primesGreaterThanTen = (List<Integer>) parser.parseExpression("#primes.?[#this>10]").getValue(context);