随笔分类 - Spring
Spring
摘要:以上是工程文件,下面开始测试package test.testservice;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.beans.factory.annotation.Autow...
阅读全文
摘要:service接口package com.fangjian.core.platform.service;import com.fangjian.core.platform.po.User;public interface UserService { void saveUser(User use...
阅读全文
摘要:jdbc.properties#hibernate settings hibernate.show_sql=truehibernate.format_sql=truehibernate.cache.use_query_cache=truehibernate.cache.provider_class=...
阅读全文
摘要:json_test login.jsp contextConfigLocation classpath:com/config/spring/spring-*.xml org.springframework.web.conte...
阅读全文
摘要:/* * 从配置ApplicationResources.properties获取文件jfDsFtpGtgsPath存取路径 */ public String getApplicationResourcesByKey(String properties,String key){ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(properties); Properties props = new Properties()...
阅读全文
摘要:配置文件放到哪都是可以取到的。。。。。。1、web项目applicationContext.xml在webRoot/web-info/下public class ChaneTest { @Test public void test() { XmlBeanFactory factory = new XmlBeanFactory(new FileSystemResource( "WebRoot/WEB-INF/applicationContext.xml")); //还可以加载其它相关配置文件 factory.add() ...
阅读全文
摘要:一、准备工作1、web工程加载spring所需的jar2、如果需要使用spring的IOC注入的最后都采取面向接口的编程,避免出现无法预料的事情<!-- services --><bean id="chatService" class="cn.com.xgr.iservcesImpl.ChatServiceImpl"> <property name="dao"> <ref bean="testDao"/> </property></bean>&
阅读全文
浙公网安备 33010602011771号