Skip to content

Commit

Permalink
refactor: SpringElParser에서 템플릿을 이용해 동적으로 key를 바인딩하기 위해 TemplateParser…
Browse files Browse the repository at this point in the history
…Context 추가
  • Loading branch information
DrRivaski committed Aug 20, 2024
1 parent fa98c48 commit d470591
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.softeer.backend.global.util;

import org.springframework.expression.ExpressionParser;
import org.springframework.expression.common.TemplateParserContext;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;

Expand All @@ -16,6 +17,6 @@ public static Object getDynamicValue(String[] parameterNames, Object[] args, Str
context.setVariable(parameterNames[i], args[i]);
}

return parser.parseExpression(key).getValue(context, Object.class);
return parser.parseExpression(key, new TemplateParserContext()).getValue(context, Object.class);
}
}

0 comments on commit d470591

Please sign in to comment.