spring配置类,即在类上加@Configuration注解,使用这种配置类来注册bean,效果与xml文件是完全一样的,只是创建springIOC容器的方式不同: //通过xml文件创建springIOC容器ApplicationContext applicationContext = new ClassPathXmlApplicationContext("/spring-beans.xml"); //通过配置类创建springIOC容器 ApplicationContext ap…
在看Spring MVC的官方文档时,最后一章是关于Spring对于其它Web框架的支持(如JSF,Apache Struts 2.x,Tapestry 5.x),当然Spring自己的MVC框架Spring MVC就不用多说了. 这里并不想讨论其它的Web框架,而是记录下这章开头提到的关于Spring为何还要支持其它Web框架. Spring Framwork的一个核心价值观是:允许开发者自由选择. 一般而言,Spring并不会强迫你使用或者购买某些特别的架构.技术或者方案,尽管它们肯定会特别…
/// designed by Alex /// 解决内存溢出问题,不可使用迭代器和foreach /// 循环遍历List, 别生成xml,一边释放 /// 反向遍历,相当于出栈,避免索引顺序乱的问题 /// 反转List. ) { log.Debug("反转list"); zrate.RateList.Reverse(); log.Debug("循环遍历Zrate List 生成xml"); int policySize = zrate.RateList.Cou…
问题1 如何让web容器加载你的web MVC框架 对于基于servlet的web容器来说,遵循的是servlet规范,入口配置文件是web.xml.这类web容器会在启动的时候会而且仅会加载如下三种类型的对象: servlet context listener filter 而且有一定的加载和销毁顺序! Loading Servlets, Context Listeners, and Filters Servlets, Context Listeners, and Filters are lo…
提供者: <!-- 1.指定当前服务/应用的名字(同样的服务名字相同,不要和别的服务同名) --> <dubbo:application name="user-service-provider"></dubbo:application> <!-- 2.指定注册中心的位置 --> <!-- <dubbo:registry address="zookeeper://127.0.0.1:2181"><…
package com.etc.pojo; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class SpUtil { static private ApplicationContext ac; static { ac = new ClassPathXmlApplicat…
package com.etc.test; import org.junit.Test; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.…
分类: Extjs2013-01-24 00:01 2068人阅读 评论(2) 收藏 举报 当在eclipse中的web工程中增加了extjs4,出现An internal error occurred during: "Building workspace". Java heap space 错误. 解决办法1:把extjs4的工程安装包不要放到web工程中就ok或者建议直接用myeclipse直接导入的exjts4包,就没问题. 解决办法2:导入ExtJS包,这样会卡死eclips…
Spring的WEB模块用于整合Web框架,例如Struts 1.Struts 2.JSF等 整合Struts 1 继承方式 Spring框架提供了ActionSupport类支持Struts 1的Action.继承了ActionSupport后就能获取Spring的BeanFactory,从而获得各种Spring容器内的各种资源 import org.springframework.web.struts.ActionSupport; public class CatAction extends…
首先来看下xml的一些概念: xml的schema里有namespace,可以给它起个别名.比如常见的spring的namespace: xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" 通常情况下,namespace对应的URI是一个存放XSD的地址,尽管规范没有这么要求.如果没有提供…