import com.cnksi.danger.manage.basic.dao.ResourceDao;
import com.cnksi.danger.manage.basic.entity.Resource;
import com.cnksi.danger.manage.web.Constants;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ServletContextAware;
import javax.servlet.ServletContext;
import java.util.List;
@Service
public class InitDataListener implements InitializingBean, ServletContextAware {
@Autowired
private ResourceDao resourceDao;
@Override
public void afterPropertiesSet() throws Exception {
}
@Override
public void setServletContext(ServletContext servletContext) {
List<Resource> resourcesList=resourceDao.findAll();
System.out.println("----------"+resourcesList);
}
}