/**
* 2014-7-2
* PubSubController.java
* author:Edwin Chen
*/
package com.chr.controller;
import java.util.ArrayList;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.chr.domain.MessageList;
import com.chr.service.impl.PubServiceImpl;
import com.chr.service.impl.SubServiceImpl;
/**
* @author new
*
*/
@Controller
@RequestMapping(value = "/pubsub")
public class PubSubController {
@Resource(name = "pubServiceImpl")
private PubServiceImpl pubService;
@Autowired
private SubServiceImpl subService;
@RequestMapping(value = "/sub")
public String Subscriber(Model model) {
MessageList messageList = subService.getMessageList();
ArrayList<String> arrayList = (ArrayList<String>) messageList.output();
model.addAttribute("arrayList", arrayList);
return "/WEB-INF/jsp/subResult.jsp";
}
@RequestMapping(value = "/pub", method = RequestMethod.GET)
public String Subscriber() {
return "/WEB-INF/jsp/pub.jsp";
}
@RequestMapping(value = "/pub", method = RequestMethod.POST)
public String Publisher(
@RequestParam(value = "message", required = true) String message) {
pubService.Publisher(message);
return "/WEB-INF/jsp/pubResult.jsp";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
springMVC集成spring-data-redis
共47个文件
xml:9个
java:7个
class:7个
5星 · 超过95%的资源 需积分: 43 38 下载量 201 浏览量
2017-08-01
13:44:19
上传
评论
收藏 25KB RAR 举报
温馨提示
redis-service_pubsub.rar。 springMVC集成spring-data-redis实现发布订阅。
资源推荐
资源详情
资源评论
收起资源包目录
redis-service_pubsub.rar (47个子文件)
redis-service
pom.xml 4KB
target
test-classes
m2e-jee
web-resources
META-INF
maven
redis-web
redis-web
pom.xml 4KB
pom.properties 242B
MANIFEST.MF 104B
m2e-wtp
web-resources
META-INF
maven
redis-web
redis-web
pom.xml 4KB
pom.properties 247B
MANIFEST.MF 104B
classes
property
redis.properties 139B
config
spring-context.xml 1022B
redis-context.xml 3KB
com
chr
domain
MessageList.class 1KB
test
PubSubTest.class 995B
controller
PubSubController.class 2KB
service
SubService.class 182B
PubService.class 117B
impl
SubServiceImpl.class 1KB
PubServiceImpl.class 923B
.settings
com.genuitec.eclipse.j2eedt.core.prefs 1KB
org.eclipse.m2e.core.prefs 90B
org.eclipse.wst.jsdt.ui.superType.name 6B
com.genuitec.eclipse.core.prefs 114B
org.eclipse.wst.common.project.facet.core.xml 252B
org.eclipse.core.resources.prefs 62B
org.eclipse.wst.common.component 674B
com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs 89B
org.eclipse.wst.jsdt.ui.superType.container 49B
.jsdtscope 508B
org.eclipse.jdt.core.prefs 364B
src
test
java
com
chr
test
PubSubTest.java 780B
main
webapp
META-INF
MANIFEST.MF 36B
WEB-INF
web.xml 1KB
classes
jsp
subResult.jsp 917B
pubResult.jsp 903B
pub.jsp 962B
lib
index.jsp 834B
resources
property
redis.properties 139B
config
spring-context.xml 1022B
redis-context.xml 3KB
java
com
chr
domain
MessageList.java 553B
controller
PubSubController.java 2KB
service
PubService.java 164B
SubService.java 254B
impl
PubServiceImpl.java 680B
SubServiceImpl.java 1KB
.project 2KB
.mymetadata 320B
.classpath 671B
共 47 条
- 1
资源评论
- _AnHua2019-03-22很全,什么都有了,感谢.ljheee2019-03-22有帮助就好
ljheee
- 粉丝: 823
- 资源: 440
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功