package com.game.products.web.actions;
import java.util.Collection;
import org.acegisecurity.Authentication;
import org.acegisecurity.context.SecurityContextHolder;
import com.game.commons.AbstractAction;
import com.game.commons.Pager;
import com.game.commons.IPagerService;
import com.game.products.model.Products;
import com.game.products.services.iface.IProductsService;
public class ProductsAction extends AbstractAction {
private IProductsService productsService;
private IPagerService pagerService;
private Products product;
private Pager pager;
protected Collection availableItems;
protected String currentPage;
protected String pagerMethod;
protected String totalRows;
protected String gameId;
protected String queryName;
protected String queryValue;
protected String searchName;
protected String searchValue;
protected String queryMap;
protected String startRow;
public String list() throws Exception {
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
this.setCurrentPage(this.getCurrentPage());
this.setStartRow(this.getStartRow());
int totalRow=productsService.getRows(this.getQueryName(),this.getQueryValue());
pager=pagerService.getPager(this.getCurrentPage(), this.getPagerMethod(), totalRow);
this.setCurrentPage(String.valueOf(pager.getCurrentPage()));
this.setTotalRows(String.valueOf(totalRow));
if(this.getStartRow()!=null)
availableItems=productsService.getProducts(this.getQueryName(),this.getQueryValue(),pager.getPageSize(), Integer.parseInt(this.getStartRow()));
else{
availableItems=productsService.getProducts(this.getQueryName(),this.getQueryValue(),pager.getPageSize(), pager.getStartRow());
this.setStartRow(String.valueOf(pager.getStartRow()));
}
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
this.setSearchName(this.getQueryName());
this.setSearchValue(this.getQueryValue());
//this.setCurrentPage(this.getCurrentPage());
return SUCCESS;
}
public String load() throws Exception {
if(gameId!=null)
product = productsService.getProduct(gameId);
else
gameId=productsService.getMaxID();
this.setCurrentPage(this.getCurrentPage());
this.setStartRow(this.getStartRow());
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
return SUCCESS;
}
public String save() throws Exception {
if(this.getProduct().getGamePrice().equals("")){
this.getProduct().setGamePrice("0.0");
}
this.setCurrentPage(this.getCurrentPage());
this.setStartRow(this.getStartRow());
String id=this.getProduct().getGameId();
Products pd=productsService.getProduct(id);
if(pd == null)
productsService.addProduct(this.getProduct());
else
productsService.updateProductd(this.getProduct());
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
return SUCCESS;
}
public String delete() throws Exception {
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
this.setStartRow(this.getStartRow());
this.setCurrentPage(this.getCurrentPage());
productsService.deleteProduct(this.getGameId());
return SUCCESS;
}
public Products getProduct() {
return product;
}
public void setProduct(Products product) {
this.product = product;
}
public Collection getAvailableItems() {
return availableItems;
}
public String getCurrentPage() {
return currentPage;
}
public void setCurrentPage(String currentPage) {
this.currentPage = currentPage;
}
public String getPagerMethod() {
return pagerMethod;
}
public void setPagerMethod(String pagerMethod) {
this.pagerMethod = pagerMethod;
}
public Pager getPager() {
return pager;
}
public void setPager(Pager pager) {
this.pager = pager;
}
public String getTotalRows() {
return totalRows;
}
public void setTotalRows(String totalRows) {
this.totalRows = totalRows;
}
public String getGameId() {
return gameId;
}
public void setGameId(String gameId) {
this.gameId = gameId;
}
public String getQueryName() {
return queryName;
}
public void setQueryName(String queryName) {
this.queryName = queryName;
}
public String getQueryValue() {
return queryValue;
}
public void setQueryValue(String queryValue) {
this.queryValue = queryValue;
}
public String getSearchName() {
return searchName;
}
public void setSearchName(String searchName) {
this.searchName = searchName;
}
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getQueryMap() {
return queryMap;
}
public void setQueryMap(String queryMap) {
this.queryMap = queryMap;
}
public String getStartRow() {
return startRow;
}
public void setStartRow(String startRow) {
this.startRow = startRow;
}
public IPagerService getPagerService() {
return pagerService;
}
public void setPagerService(IPagerService pagerService) {
this.pagerService = pagerService;
}
public IProductsService getProductsService() {
return productsService;
}
public void setProductsService(IProductsService productsService) {
this.productsService = productsService;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Struts2_0+spring2_0+hibernate3_1 Web应用示例代码 (125个子文件)
ProductsAction.class 6KB
ProductsMapDao.class 4KB
DataSourceMethodDefinitionSourceEditor.class 2KB
ProductsService.class 2KB
Pager.class 2KB
Products.class 2KB
SetCharacterEncodingFilter.class 2KB
Test.class 2KB
ProductsMapDao$2.class 2KB
ProductsMapDao$1.class 1KB
PublicUtil.class 1KB
PagerService.class 1KB
IProductsService.class 705B
ProductsDao.class 666B
AbstractAction.class 322B
IPagerService.class 209B
.classpath 1KB
.cvsignore 7B
.cvsignore 4B
Entries 1KB
Entries 391B
Entries 310B
Entries 260B
Entries 180B
Entries 143B
Entries 140B
Entries 127B
Entries 97B
Entries 94B
Entries 67B
Entries 55B
Entries 53B
Entries 51B
Entries 50B
Entries 46B
Entries 43B
Entries 30B
Entries 17B
Entries 15B
Entries 12B
ProductsAction.java 5KB
ProductsMapDao.java 5KB
ProductsService.java 2KB
DataSourceMethodDefinitionSourceEditor.java 2KB
Pager.java 2KB
Products.java 2KB
SetCharacterEncodingFilter.java 1KB
Test.java 1KB
PublicUtil.java 888B
PagerService.java 865B
IProductsService.java 719B
ProductsDao.java 707B
IPagerService.java 137B
AbstractAction.java 134B
list.jsp 6KB
login.jsp 1KB
editProduct.jsp 1KB
accessDenied.jsp 911B
index.jsp 321B
.project 439B
log4j.properties 672B
log4j.properties 672B
ProductsAction.properties 204B
ProductsAction.properties 204B
Struts.properties 82B
Struts.properties 82B
Repository 51B
Repository 50B
Repository 48B
Repository 46B
Repository 45B
Repository 42B
Repository 42B
Repository 40B
Repository 40B
Repository 36B
Repository 35B
Repository 32B
Repository 29B
Repository 27B
Repository 22B
Repository 18B
Repository 18B
Repository 18B
Repository 15B
Repository 14B
Repository 6B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
Root 37B
共 125 条
- 1
- 2
资源评论
- zhouyh_7892013-05-21一个简单的整合框架
- dfspring2014-09-27Ssh标准框架培训入门例子
- cphubu2013-10-17虽然简单,学习了。
whetu
- 粉丝: 29
- 资源: 107
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 三菱PLC例程源码单钮起停控制程序三例
- oracle相关数据库的知识,包括建表语句,索引视图,触发器存储过程等
- MATLAB人脸识别+可调摄像头,库外判别预警,GUI界面.zip
- Oracle数据库备份与恢复.pdf
- 302P-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 基于servlet的游戏商城(采用RESTful架构风格).zip
- 三菱PLC例程源码单按钮正反停
- C# 飞机大战项目, 获取道具,双排子弹 散弹的实现
- 三菱PLC例程源码单按钮五台电机启停控制SFC程序
- 基于QT实现的酒店管理系统+图形化界面提供客房、员工管理所需的操作+源码(毕业设计&课设&项目开发)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功