Spring之初见端倪——配置篇

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>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值