我想插入 Spring Basics: Dynamically Inject Values With Spring's @Value。我该怎么做?
我尝试了代码
@Value("#{{2: 'Catch22', 22: '1984', 32: 'Pride and Prejudice'}}")
但我有例外
private Map <Integer,String>studentTeacherMap;
@Value("#{{2: 'Catch22', 22: '1984', 32: 'Pride and Prejudice'}}")
public Map<Integer, String> loki()
return studentTeacherMap;
我希望输出是
2= Catch22, 22= 1984, 32= Pride and Prejudice
但最终出现了例外:
Cannot handle (123) '{'