AppSecretManager 读取数据库失败

jyb0119 2014-08-15

 public boolean isValidAppKey(String appKey) {
ValidAppKeyDao action=new ValidAppKeyDaoImpl();
    return action.validAppKey(appKey);

}


无法获取到jdbcTemplate,谁遇到过?
bocoepms 2014-09-09
前段时间看rop也没发现了类似的问题,我是写了个spring的工具,通过工具来获取spring的bean来处理掉的
rop扩展spring的配置 具体为什么不支持这样的配置 需要 @stamen来解释一下了
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 14-5-5
 * Time: 下午1:53
 * To change this template use File | Settings | File Templates.
 */
@Component
public class SpringContextUtil implements ApplicationContextAware {
	private static ApplicationContext applicationContext;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		this.applicationContext = applicationContext;
	}

	public static Object getBean(String beanName) {
        return applicationContext.getBean(beanName);
    }
    public static Object getBean(Class requiredType) {
        return applicationContext.getBean(requiredType);
    }
}
Long_yuan 2015-05-25
alidAppKeyDao action=new ValidAppKeyDaoImpl(); 

你这行直接new对象 spring不会注入
Global site tag (gtag.js) - Google Analytics