GamePackService gamePackService;
@Override
public void init() throws ServletException
{
super.init();
WebApplicationContext wac = WebApplicationContextUtils
.getRequiredWebApplicationContext(getServletContext());
gamePackService = (GamePackService) wac.getBean("gamePackService");
}、
在servlet init 方法中加入