java springmvc jms_Spring mvc4 + ActiveMQ 整合

转载:http://www.cnblogs.com/leiOOlei/p/5075402.html

一、配置部分

ActiveMQ的安装这就不说了,很简单,

这个例子采用maven构建,首先看一下pom.xml

48304ba5e6f9fe08f3fa1abda7d326ab.png

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

4.0.0

com.gzframe.demo

gzframe

war

0.0.1-SNAPSHOT

gzframe Maven Webapp

http://maven.apache.org

4.1.8.RELEASE

3.1.0

junit

junit

4.10

test

jstl

jstl

1.2

javax.servlet

servlet-api

${javax.servlet}

org.springframework

spring-core

${springframework}

org.springframework

spring-context

${springframework}

org.springframework

spring-tx

${springframework}

org.springframework

spring-webmvc

${springframework}

org.springframework

spring-jms

${springframework}

org.apache.xbean

xbean-spring

3.16

org.apache.activemq

activemq-core

5.7.0

org.apache.activemq

activemq-pool

5.12.1

gzframe

48304ba5e6f9fe08f3fa1abda7d326ab.png

接下来看一下web.xml,如下

48304ba5e6f9fe08f3fa1abda7d326ab.png

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

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"

version="3.0">

Archetype Created Web Application

contextConfigLocation

classpath:spring-root.xml;

classpath:activemq.xml;

org.springframework.web.context.ContextLoaderListener

springMVC

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:spring-mvc-dispatch.xml

1

springMVC

/

characterEncodingFilter

org.springframework.web.filter.CharacterEncodingFilter

encoding

UTF-8

forceEncoding

true

characterEncodingFilter

/*

48304ba5e6f9fe08f3fa1abda7d326ab.png

其中spring-root.xml 很简单,负责加载一些spring的配置

48304ba5e6f9fe08f3fa1abda7d326ab.png

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

xmlns:context="http://www.springframework.org/schema/context"

xmlns:mvc="http://www.springframework.org/schema/mvc"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-4.1.xsd

http://www.springframework.org/schema/mvc

http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">

48304ba5e6f9fe08f3fa1abda7d326ab.png

spring-mvc-dispatch.xml如下

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值