Spring框架目前在我看来是Java Web中最经典也是最为成功web框架,作为轻量级的框架,有许多优点。
Spring的特点是:IOC控制反转、AOP面向切面编程、反射机制等。我觉得最重要的特性之一是bean。
下面介绍一下相关文件的配置。
1.business配置文件
页面初始登录、页面跳转、domian对象、service-bean(执行方法)
<business>
<business name="applicationDataBusiness" do="spring:applicationDo"
service-bean="spring:applicationBusiness" start-step="queryAppinfoList" extends="xxx" permission-id="xxx" >
<step name="queryAppinfoList" view="WEB-INF/xxx/xxx/queryAppinfoList.usl">
</step>
</business>
2.spring配置文件
配置 类之间对象的注入,每个类唯一标识id,以便bussiness.xml调用
<bean id="applicationBusiness" class="com.xxx.xxx.business.ApplicationBusiness">
<property name="applicationService">
<bean id="applicationDo" class="com.xxx.xxx.domain.ApplicationDo">
<scope="prototype">
...
<bean class="com.xxx.xxx.service.ApplicationServiceImpl">
<property name="applicationDao">
<ref bean="applicationDaoImpl" />
</property>
</bean>
</property>
</bean>
3.sql配置文件
sql语句
<sql id="queryAppinfo" datasource="ds001">
<content>
<![CDATA[
SELECT * FROM TABLE1
]]>
</content>
</sql>