代码如下:
@Repository("servletDownload")
public class ServletDownload extends HttpServlet {
private static final long serialVersionUID = 1L;
@Resource(name="userOperationLogManager")
private UserOperationLogManager userOperationLogManager;
@Resource(name="userOperationLogManager")注入实现数据持久化,但是下面的报错。
信息: Servlet fileDownloadServlet is currently unavailable
但是如果把@Resource去掉以后,userOperationLogManager中的
@Resource
private UserOperationLogDao userOperationLogDao;
便为空指针。
首先你得确定你的userOperationLogManager是否已经注册spring的bean
这个很resource有关系么 说的是你的servlet找不到 你的配置文件是不是有错?
首先你得确定你的userOperationLogManager是否已经注册spring的bean