摘要: 不使用Spring,怎样能在Listener启动的Thread中获取web目录,还真不完全确定。其实我觉得实际代码也很简单。就是基于普通的listener,然后在listener中获取web目录并放到JRE全局变量中。但使用Spring,就可以用一种比较优雅的方式来获取了。在web.xml中的节点内加入: webAppRootKey tansungWeb.root org.springframework.web.util.WebAppRootListener 然后在普通的Java类中(不是a... 阅读全文
posted @ 2013-09-03 10:06 春哥也编程 阅读(578) 评论(0) 推荐(0)