点击这里给我发消息 点击这里给我发消息

在Spring 2中整合DWR 2

添加时间:2013-12-7
    相关阅读: DW

    前些日子看了一篇关于在Spring 2中整合DWR 2的文章《AJAX, DWR and Spring》。最近,想动手试一下,就下载其源代码回来看看,依葫芦画瓢做了一遍。在运行时,得到XML验证错误。经过一翻折腾,终于把问题解决。

    Spring 2基于XML Schema的配置
    众所周知,Spring 2通过XML Schema配置方式极大地简化的其配置,而且使得第三方扩展变为可能。配置如下代码所示:

    <? xml version="1.0" encoding="UTF-8" ?>

     < beans xmlns =http://www.springframework.org/schema/beans

         xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance

         xsi:schemaLocation ="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" >

                  <!-- <bean /> definitions here -->

          </ beans >
    清单1 applicationContext.xml
    不知大家有没有想过spring-beans-2.0.xsd位置在那里?其实,大家可以用Eclipse打开Spring的jar包,展开META-INF,并双击打开其中的spring.schemas文件,内容如下:

    http\://www.springframework.org/schema/beans/spring-beans- 2.0 .xsd = org/springframework/beans/factory/xml/spring-beans- 2.0 .xsd

     http\://www.springframework.org/schema/tool/spring-tool- 2.0 .xsd = org/springframework/beans/factory/xml/spring-tool- 2.0 .xsd

     http\://www.springframework.org/schema/util/spring-util- 2.0 .xsd = org/springframework/beans/factory/xml/spring-util- 2.0 .xsd

     http\://www.springframework.org/schema/aop/spring-aop- 2.0 .xsd = org/springframework/aop/config/spring-aop- 2.0 .xsd

     http\://www.springframework.org/schema/lang/spring-lang- 2.0 .xsd = org/springframework/scripting/config/spring-lang- 2.0 .xsd

     http\://www.springframework.org/schema/tx/spring-tx- 2.0 .xsd = org/springframework/transaction/config/spring-tx- 2.0 .xsd

     http\://www.springframework.org/schema/jee/spring-jee- 2.0 .xsd = org/springframework/ejb/config/spring-jee- 2.0 .xsd

     http\://www.springframework.org/schema/beans/spring-beans.xsd = org/springframework/beans/factory/xml/spring-beans- 2.0 .xsd

     http\://www.springframework.org/schema/tool/spring-tool.xsd = org/springframework/beans/factory/xml/spring-tool- 2.0 .xsd

     http\://www.springframework.org/schema/util/spring-util.xsd = org/springframework/beans/factory/xml/spring-util- 2.0 .xsd

     http\://www.springframework.org/schema/aop/spring-aop.xsd = org/springframework/aop/config/spring-aop- 2.0 .xsd

     http\://www.springframework.org/schema/lang/spring-lang.xsd = org/springframework/scripting/config/spring-lang- 2.0 .xsd

     http\://www.springframework.org/schema/tx/spring-tx.xsd = org/springframework/transaction/config/spring-tx- 2.0 .xsd

     http\://www.springframework.org/schema/jee/spring-jee.xsd = org/springframework/ejb/config/spring-jee- 2.0 .xsd

[1] [2] [3] 下一页

咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册