如何在tapestry中注入DAO bean(使用Spring JDBC)

时间:2017-04-12 11:06:20

标签: spring-jdbc tapestry

我在使用带有Tapestry的Spring-JDBC并且无法注入我在Spring.xml中定义的DAO bean。通常我们使用applicationContext.getBean,但在tapestry中我无法找到这样的选项。请指导我如何注入DAO bean以在我的代码中使用它。以下是我的代码:

Class ABC{
with private members, getters,setters and constructors
} 

Class abcDAO{
private JdbcTemplate template
//getter and setter for jdbc template

//a method which will extract data using Rowmapper
public Set<ABC> getAll(){
//override mapRow method
}
}


I want to use getAll method in a class which will process extracted data. Please help me where should I inject abcDAO bean with below line:

@Inject private abcDAO abcDao;

Thanks in advance!!!

0 个答案:

没有答案