`

spring util

    博客分类:
  • J2EE
 
阅读更多
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.java

    SpringUtil.java

    SpringUtil工具类(获取applicationContext,通过name获取 Bean,通过class获取Bean,通过name,以及Clazz返回)

    Spring的getBean和JdbcTemplate

    NULL 博文链接:https://summerbell.iteye.com/blog/364702

    spring-web-2.5.jar

    META-INF/MANIFEST.MF META-INF/license.txt org.springframework.remoting.caucho.BurlapClientInterceptor.class org.springframework....org/springframework/web/util/HtmlCharacterEntityReferences.properties

    spring约束,aop、beans、context、tool、tx、util

    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

    java底层代码:泛型DAO+SSH+Proxool连接池+国际化语言

    2、采用Jsp->Action->Service->Dao的编码方式,封装了HibernateUtil、SpringUtil、HqlUtil等工具,以及简化了增删查改操作。 3、此底层包含泛型DAO、Proxool连接池、国际化语言、DateUtil工具、ExcelUtil报表工具、...

    Spring框架依赖jar包

    Spring框架依赖jar包,其中最小依赖包:org.springframework.core、org.springframework.context、org.springframework.beans、org.springframework.asm、org.springframework.expression、...

    Java项目开发常用工具包util

    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项目工程

    SpringBoot2.1.0与Dubbo2.6.5基于properties文件的整合--Maven项目工程

    Spring实战之使用util:命名空间简化配置操作示例

    主要介绍了Spring实战之使用util:命名空间简化配置操作,结合实例形式分析了Spring使用util:命名空间简化配置操作的具体步骤与相关操作注意事项,需要的朋友可以参考下

    spring-util-4.2.xsd.zip

    压缩包内含有该文件所对应的URI,当开发环境没有网络或者远程获取速度过慢时能用到,希望能帮助到有需要的同学。

    java拦截器

    heartbeatService = SpringUtil.getBean(HeartbeatServiceImpl.class); return heartbeatService.setOutDate(token); }else { response.sendRedirect(serverConfig.SERVER + "loginInfo/login11"); return true...

    spring2.5基于注解例子程序

    spring2.5基于注解的例子程序,包含相关jar包

    spring约束文件大全

    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、

    spring4示例代码

    spring-1 演示了使用setter方式及构造器方式创建bean,util:list标签创建集合,p标签简化配置 和依赖注入, 以及bean的autowire和继承与依赖,以及bean的作用域。 spring-2 演示了外部配置文件的引入(connection)...

    AnyFo - Util - AnyFoDao :Spring + Hibernate整合通用的DAO层类

    本类封装了Spring提供的HibernateTemplate,从提供了对数据的各种操作,因此,本类尤其适合用Spring + Hibernate整合后进行系统开 发时使用。 AnyFoAction功能概述 AnyFoDao中的那个类,提供多个方法来对...

    spring的各个约束包

    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文件

    spring全套xsd文件,放入xml catalog中后,会自动自动提示spring标签

    spring3.2.0相关jar包以及xsd.zip

    其中包含了spring3.2.0的相关jar包,还有xml中自动提示的本地xsd文件。

Global site tag (gtag.js) - Google Analytics