//FINAL
package com.watson.rest.json;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.watson.rest.feeds.TournamentContent;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Controller
public class FeedController {
@RequestMapping("/jsonfeed")
public String getJSON(Model model) {
List<TournamentContent> tournamentList = new ArrayList<TournamentContent>();
tournamentList.add(TournamentContent.generateContent("FIFA", new Date(), "World Cup", "www.fifa.com/worldcup/"));
tournamentList.add(TournamentContent.generateContent("FIFA", new Date(), "U-20 World Cup", "www.fifa.com/u20worldcup/"));
tournamentList.add(TournamentContent.generateContent("FIFA", new Date(), "U-17 World Cup", "www.fifa.com/u17worldcup/"));
tournamentList.add(TournamentContent.generateContent("FIFA", new Date(), "Confederations Cup", "www.fifa.com/confederationscup/"));
model.addAttribute("items", tournamentList);
model.addAttribute("status", 0);
return "jsontournamenttemplate";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
RESTFUL + SPRINGMVC + C3P0连接池 的完美实现. 传递json数据到springmvc自动转为obj。obj传前台可直接转换为json。 rest配置文件内 修改,可同理兼容 JSON XML AMF 或其他各种。
资源推荐
资源详情
资源评论
收起资源包目录
rest-spring.zip (33个子文件)
rest-spring
.project 1KB
.DS_Store 6KB
src
.DS_Store 6KB
test
.DS_Store 6KB
resources
java
main
.DS_Store 6KB
webapp
WEB-INF
.DS_Store 6KB
lib
rest-servlet.xml 3KB
web.xml 2KB
.DS_Store 6KB
index.jsp 52B
META-INF
MANIFEST.MF 39B
resources
.DS_Store 6KB
log4j.properties 791B
java
.DS_Store 6KB
com
.DS_Store 6KB
watson
.DS_Store 6KB
rest
.DS_Store 12KB
xml
feeds
.DS_Store 6KB
TournamentContent.java 976B
json
.DS_Store 6KB
FeedController.java 1KB
atom
target
classes
com
watson
rest
xml
feeds
TournamentContent.class 1KB
json
FeedController.class 2KB
atom
log4j.properties 791B
test-classes
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 252B
org.maven.ide.eclipse.prefs 249B
org.eclipse.jdt.core.prefs 695B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 592B
.jsdtscope 508B
pom.xml 4KB
.classpath 928B
共 33 条
- 1
cfxinxin
- 粉丝: 2
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页