ITeye博客

spring

共 1 篇文章

spring jdbcTemplate 注入到servlet

最近温了一下 Spring jdbcTemplate. 在使用纯粹Servlet 时发现一个问题,就是在使用纯粹Servlet 做控制器时,出现了各种问题。归纳如下: (1) 报找不到 applicationContext.xml 的spring配置文件。 原因:一般情况下我们会将applicationContext.xml 放置在 WEB-INF/下,这时在servlet中用硬编码的方式 wc = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()); TrainDirectionD…

2009-11-25 01:06 · spring · DAO · Spring · XML · Web · Servlet