SpringFramework(11) (完)

8Web

1WebApplicationContext

l         应用程序context位于war文件中

Ø         每个应用程序具有单一的根context

Ø         缺省是:/WEB-INF/applicationContext.xml

l         context被下面加载:

Ø         ContextLoaderListener(Servlet2.4)

Ø         ContextLoaderServlet(Servlet2.3)

l         可以使用任何的Web框架,Spring只是作为一个类库

l         例子:

Ø         web.xml

<context-param>
    
    
<param-name>contextConfigLocation</param-name>
    
    
<param-value>/WEB-INF/applicationContext.xml</param-value>
    
    
</context-param>
    
    
<listener>
    
    
<listener-class>...web.context.ContextLoaderListener</listener-class>
    
    
</listener>
    
    

Ø         servlet

WebApplicationContextUtils.getWebApplicationContext(ServletContext);
    
    

 

9Web MVC

l         参考《Developoing a Sring Framework MVC application step-by-step》(即将翻译)

 

10、远程访问(Remoting

1RemoteExporter

l         context中的任何Bean多可以被输出

l         RemoteExporter以远程服务的方式输出Bean

l         内建支持:

Ø         RMI

Ø         JAX-RPC

Ø         Burlap

Ø         Hessian

2RmiServiceExporter

l         要被输出的服务

class MyServiceImpl implements MyService {
    
    
...
    
    
}
    
    
<bean id="myService" class="app.MyServiceImpl"/>
    
    

l         服务输出者

<bean id="myService-rmi"
    
    
class="...remoting.rmi.RmiServiceExporter">
    
    
<property name="service"><ref local="myService"/></property>
    
    
<property name="serviceInterface">
    
    
<value>app.MyService</value>
    
    
</property>
    
    
<property name="serviceName">
    
    
<value>myService</value>
    
    
</property>
    
    
</bean>
    
    

 

11、更多

1)线路图

l         Spring1.1

Ø         支持JMS

Ø         支持JMX

Ø         基于规则的声明式验证

Ø         AOP pointcut 表达式语言,JSR175 preview

l         Spring1.2

Ø         支持OGNL

Ø         支持JCA

Ø         增强RML支持

l         Spring1.3 ?

Ø         JSF

Ø         Portlets

2)相关的项目

l         胖客户平台(sandbox):Spring RCP

l         验证(sandbox):通用验证;基于属性

l         安全:Acegi Security System for Spring

 

(译者:2004728日,Spring Framework 1.1 RC1发布,与1.0相比,主要增加了AspectJ集成、JMS支持、远程访问和Web服务支持的增强,具体内容可以参考附带文档中的spring-reference.pdf

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值