728x90
반응형
@Autowired
private ApplicationContext apc;
...
public void method(){
...
String sBeanList[] = apc.getBeanDefinitionNames();
for(String sTemp : sBeanList){
if("senarioMgmtSenario".equals(sTemp) == true){
Object obj = apc.getBean(sTemp);
Class targetclass = Class.forName(obj.getClass().getName());
Class argsType[] = new Class[1];
argsType[0] = SenarioDtl.class;
java.lang.reflect.Method method = targetClass.getDeclaredMethod("methodName", argsType);
method.invoke(obj, senarioDto);
break;
}
}
}
728x90
반응형
'Frameworks > spring' 카테고리의 다른 글
[Spring] IoC(Inversion Of control), DI(Dependecy Injection) (0) | 2024.04.05 |
---|---|
[spring boot + intellij + jsp] 조합 jsp 404 not found error (0) | 2024.03.31 |