web.xml中配置spring配置(application.xml)文件
2016-06-03 14:17
453 查看
application.xml 一般放到WEB-INF下,当然,你也可以将它放到任意问题,但需要web.xml指向到该文件
1、application.xml配置
配置后,我在进行cxf发布服务时,出现
异常。
网上查询资料解决方案是修改application.xml信息
2、web.xml配置
例如:
在此,我将application.xml改名为spring.xml,并将它放到WEB-INF下的config文件夹下
1、application.xml配置
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> </beans>
配置后,我在进行cxf发布服务时,出现
元素 "jaxws:endpoint" 的前缀 "jaxws" 未绑定
异常。
网上查询资料解决方案是修改application.xml信息
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jaxws="http://cxf.apache.org/jaxws" 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-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> </beans>
2、web.xml配置
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:applicationContext.xml </param-value> </context-param>
例如:
<!-- 配置 Spring 配置文件的名称和位置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/config/spring.xml</param-value> </context-param> <!-- 启动 IOC 容器的 ServletContextListener --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
在此,我将application.xml改名为spring.xml,并将它放到WEB-INF下的config文件夹下
相关文章推荐
- 公众号第三方平台 接入与全网发布
- [置顶] iOS系统相关参数(版本、机型设备等)
- iOS 上架 -- App store 搜索不到 解决方法
- iOS修改系统原声的返回按钮的点击事件
- Objective-C Runtime的基本使用(iOS Runtime的初体验)
- Android启动过程图解
- Android Studio 打包语言报错 is not translated
- 幸福在《精通移动App测试实战 技术、工具和案例》
- 幸福在《精通移动App测试实战 技术、工具和案例》
- 【iOS开发】字典(NSDictionary)和JSON字符串(NSString)之间互转
- Android Token和Session
- android training 笔记
- Hibernate中的Entity类之间的继承关系之一MappedSuperclass
- Java微信开发(三)之JS-SDK配置
- android工程目录结构
- 易生活(五)-APP--上拉加载更多工具类封装思路及实现
- 为Dapper编写一个类似于EF的Map配置类
- Android端 WebP图片压缩与传输的一点探索
- Android设置虚线、圆角、渐变
- android图片编解码architecture