public class Demo {
public static void main(String[] args) throws Exception {
d2();
//http://www.ibm.com/developerworks/cn/java/j-lo-spring-utils1/index.html
}
static void d1() throws Exception {
Resource res = new FileSystemResource("e:/jquery.lazyload.js");
Resource res2 = new ClassPathResource("conf/file.txt");
BufferedReader buf = new BufferedReader(new FileReader(res.getFile()));
String str;
while ((str = buf.readLine()) != null) {
System.out.println(str);
}
}
static void d2() throws Exception{
File file = ResourceUtils.getFile("classpath:applicationContext.xml");
// File file = ResourceUtils.getFile("WebRoot/applicationContext.xml");
// File file = ResourceUtils.getFile("file:D:/conf.xml");
System.out.println(file.getAbsolutePath());
BufferedReader buf = new BufferedReader(new FileReader(file));
String str;
while ((str = buf.readLine()) != null) {
// System.out.println(str);
}
}
}
分享到:
相关推荐
自定义依赖注入工具类SpringUtil.java
SpringUtil工具类(获取applicationContext,通过name获取 Bean,通过class获取Bean,通过name,以及Clazz返回)
NULL 博文链接:https://summerbell.iteye.com/blog/364702
META-INF/MANIFEST.MF META-INF/license.txt org.springframework.remoting.caucho.BurlapClientInterceptor.class org.springframework....org/springframework/web/util/HtmlCharacterEntityReferences.properties
spring约束文件,4.0版本,spring-aop-4.0.xsd、spring-beans-4.0.xsd、spring-context-4.0.xsd、spring-mvc-4.0.xsd、spring-tool-4.0.xsd、spring-tx-4.0.xsd、spring-util-4.0.xsd
2、采用Jsp->Action->Service->Dao的编码方式,封装了HibernateUtil、SpringUtil、HqlUtil等工具,以及简化了增删查改操作。 3、此底层包含泛型DAO、Proxool连接池、国际化语言、DateUtil工具、ExcelUtil报表工具、...
Spring框架依赖jar包,其中最小依赖包:org.springframework.core、org.springframework.context、org.springframework.beans、org.springframework.asm、org.springframework.expression、...
Java项目开发常用工具包,其中主要包括:Assert.java BufferedImageLuminanceSource.java CipherUtil.java ClientConst.java ...SpringUtil.java UUIDUtils.java WriteBitMatricToFile.java XmlUtil.java
SpringBoot2.1.0与Dubbo2.6.5基于properties文件的整合--Maven项目工程
主要介绍了Spring实战之使用util:命名空间简化配置操作,结合实例形式分析了Spring使用util:命名空间简化配置操作的具体步骤与相关操作注意事项,需要的朋友可以参考下
压缩包内含有该文件所对应的URI,当开发环境没有网络或者远程获取速度过慢时能用到,希望能帮助到有需要的同学。
heartbeatService = SpringUtil.getBean(HeartbeatServiceImpl.class); return heartbeatService.setOutDate(token); }else { response.sendRedirect(serverConfig.SERVER + "loginInfo/login11"); return true...
spring2.5基于注解的例子程序,包含相关jar包
spring-aop、spring-beans、spring-cache、spring-context、spring-jdbc、spring-jee、spring-jms、spring-lang、spring-mvc、spring-oxm、spring-task、spring-tool、spring-tx、spring-util、spring-websocket、
spring-1 演示了使用setter方式及构造器方式创建bean,util:list标签创建集合,p标签简化配置 和依赖注入, 以及bean的autowire和继承与依赖,以及bean的作用域。 spring-2 演示了外部配置文件的引入(connection)...
本类封装了Spring提供的HibernateTemplate,从提供了对数据的各种操作,因此,本类尤其适合用Spring + Hibernate整合后进行系统开 发时使用。 AnyFoAction功能概述 AnyFoDao中的那个类,提供多个方法来对...
spring-aop.xsd; spring-beans.xsd; spring-cache.xsd; spring-context.xsd; spring-jdbc.xsd; spring-jee.xsd;...spring-jms.xsd;...spring-lang.xsd;...spring-util.xsd; spring-websocket.xsd
spring全套xsd文件,放入xml catalog中后,会自动自动提示spring标签
其中包含了spring3.2.0的相关jar包,还有xml中自动提示的本地xsd文件。