import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import com.google.gson.Gson;
@Controller
public class -1-Action {
@Autowired
private -1-Service -2-Service;
//每页显示的数量
private final int PAGE_SIZE=10;
/**
* 查全部
*
* @return
*/
@RequestMapping("-2-/selectAll.do")
public String selectAll(-1- obj, HttpServletRequest request,
ModelMap modelmap) {
if (null == obj)
obj = new -1-();
obj.setNumber(PAGE_SIZE);
List<-1-> list_obj = -2-Service.selectAll(obj);
modelmap.put("list_obj", list_obj);
modelmap.put("obj", obj);
selectCount(obj, request, modelmap);
return "-2-";
}
/**
* 查询单个
*
* @return
*/
@RequestMapping("-2-/selectOne.do")
public String selectOne(-1- obj, ModelMap modelmap) {
-1- ret = -2-Service.selectOne(obj);
modelmap.put("obj", ret);
return "-2-";
}
/**
* ajax 查询单个
*
* @return
*/
@RequestMapping("-2-/selectOne_ajax.do")
public void selectOne_ajax(-1- obj, HttpServletResponse response) {
-1- ret = -2-Service.selectOne(obj);
String json = new Gson().toJson(ret);
try {
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
response.getWriter().print(json);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 插入
*
* @return
*/
@RequestMapping("-2-/insert.do")
public String insert(-1- obj,
HttpServletRequest request, ModelMap modelmap) {
-2-Service.insert(obj);
return selectAll(null, request, modelmap);
}
/**
* 删除
*
* @return
*/
@RequestMapping("-2-/delete.do")
public String delete(-1- obj,
HttpServletRequest request, ModelMap modelmap) {
int ret = -2-Service.delete(obj);
return selectAll(null, request, modelmap);
}
/**
* 修改
*
* @return
*/
@RequestMapping("-2-/update.do")
public String update(-1- obj,
HttpServletRequest request, ModelMap modelmap) {
int ret = -2-Service.update(obj);
modelmap.put("ret", ret);
return selectAll(null, request, modelmap);
}
/**
* 查数量
*
* @return
*/
@RequestMapping("-2-/selectCount.do")
public String selectCount(-1- obj,
HttpServletRequest request, ModelMap modelmap) {
int count = -2-Service.selectCount(obj);
modelmap.put("count", count);
return "-2-";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
WindRapid1.0.0
共43个文件
txt:25个
ssk:8个
db:3个
需积分: 4 10 下载量 47 浏览量
2014-02-11
10:10:47
上传
评论
收藏 561KB RAR 举报
温馨提示
可以快速搭建项目 支持 spring struts2 springMVC ibatis mybatis oracle mysql 建好数据库到能访问 只需要 2分钟
资源推荐
资源详情
资源评论
收起资源包目录
WindRapid.rar (43个子文件)
WindRapid
IrisSkin2.dll 504KB
WindRapid.exe 143KB
pf
Longhorn
Longhorn.ssk 19KB
Thumbs.db 6KB
Sports
SportsCyan.ssk 11KB
SportsBlack.ssk 11KB
SportsBlue.ssk 12KB
SportsOrange.ssk 13KB
Thumbs.db 19KB
SportsGreen.ssk 12KB
One
Thumbs.db 16KB
OneCyan.ssk 14KB
Page
PageColor2.ssk 9KB
MySql.Data.dll 288KB
System.Data.OracleClient_.dll 475KB
file
main_css.txt 863B
iframe_js.txt 451B
public_js.txt 868B
springMVC
action.txt 3KB
spring.txt 2KB
interceptor.txt 2KB
web.txt 1KB
main.txt 781B
jquery.simplemodal.1.4.4.min.js 10KB
jquery-1.4.js 155KB
page.js 4KB
mybatis
mybatis_dao.txt 655B
mybatis_xml.txt 167B
spring.txt 306B
mybatis_core.txt 191B
public_css.txt 810B
ibatis
ibatis_core.txt 264B
ibatis_dao.txt 2KB
spring.txt 470B
ibatis_xml.txt 155B
service.txt 1KB
jsptop.txt 758B
spring+struts
action.txt 2KB
struts_xml.txt 965B
spring.txt 2KB
interceptor.txt 533B
web.txt 1KB
struts_core.txt 1KB
共 43 条
- 1
资源评论
lyf2jiandan
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功