package com.action;
import java.util.Collection;
import com.commons.Pager;
import com.commons.PagerService;
import com.model.Contact;
import com.service.ContactService;
public class ContactAction extends AbstractAction {
private ContactService contactService;
private PagerService pagerService;
private Contact contact;
private Pager pager;
protected Collection availableItems;
protected String currentPage;
protected String pagerMethod;
protected String totalRows;
protected String contactId;
protected String queryName;
protected String queryValue;
protected String searchName;
protected String searchValue;
protected String queryMap;
public ContactAction() {
super();
}
public String list() throws Exception {
if (queryMap != null && !("".equals(queryMap))) {
String[] str = queryMap.split("~");
this.setQueryName(str[0]);
this.setQueryValue(str[1]);
}
int totalRow = contactService.getRows(this.getQueryName(), this
.getQueryValue());
System.out.println("currentPage:" + this.getCurrentPage()
+ "\tgetPagerMethod():" + this.getPagerMethod() + "\ttotalRow:"
+ totalRow);
pager = pagerService.getPager(this.getCurrentPage(), this
.getPagerMethod(), totalRow);
this.setCurrentPage(String.valueOf(pager.getCurrentPage()));
this.setTotalRows(String.valueOf(totalRow));
availableItems = contactService.getContacts(this.getQueryName(), this
.getQueryValue(), pager.getPageSize(), pager.getStartRow());
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
this.setSearchName(this.getQueryName());
this.setSearchValue(this.getQueryValue());
return SUCCESS;
}
public String load() throws Exception {
if (contactId != null)
contact = contactService.getContact(contactId);
/*
* else contactId = contactService.getMaxID();
*/
return SUCCESS;
}
public String add() throws Exception {
contact = null;
/*
* else contactId = contactService.getMaxID();
*/
return SUCCESS;
}
public String save() throws Exception {
String id = this.getContact().getId();
Contact contact = contactService.getContact(id);
if (contact == null)
contactService.addContact(this.getContact());
else
contactService.updateContact(this.getContact());
this.setQueryName(this.getQueryName());
this.setQueryValue(this.getQueryValue());
if (this.getQueryName() == null || this.getQueryValue() == null
|| this.getQueryName().equals("")
|| this.getQueryValue().equals("")) {
} else {
queryMap = this.getQueryName() + "~" + this.getQueryValue();
}
return SUCCESS;
}
public String delete() throws Exception {
contactService.deleteContact(this.getContactId());
if (this.getQueryName() == null || this.getQueryValue() == null
|| this.getQueryName().equals("")
|| this.getQueryValue().equals("")) {
} else {
queryMap = this.getQueryName() + "~" + this.getQueryValue();
}
return SUCCESS;
}
// //////////////////////////////////////////////////////////////////////////////////////
public ContactService getContactService() {
return contactService;
}
public void setContactService(ContactService contactService) {
this.contactService = contactService;
}
public PagerService getPagerService() {
return pagerService;
}
public void setPagerService(PagerService pagerService) {
this.pagerService = pagerService;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public Pager getPager() {
return pager;
}
public void setPager(Pager pager) {
this.pager = pager;
}
public Collection getAvailableItems() {
return availableItems;
}
public void setAvailableItems(Collection availableItems) {
this.availableItems = 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 String getTotalRows() {
return totalRows;
}
public void setTotalRows(String totalRows) {
this.totalRows = totalRows;
}
public String getContactId() {
return contactId;
}
public void setContactId(String contactId) {
this.contactId = contactId;
}
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;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
图书管理系统(java+jsp+oracle).rar
共101个文件
jar:46个
class:18个
java:16个
4星 · 超过85%的资源 需积分: 9 94 下载量 67 浏览量
2011-12-04
00:36:03
上传
评论 4
收藏 16.2MB RAR 举报
温馨提示
图书管理系统(java+jsp+oracle).rar
资源推荐
资源详情
资源评论
收起资源包目录
图书管理系统(java+jsp+oracle).rar (101个子文件)
ContactAction.class 6KB
ContactDaoImpl.class 4KB
ContactServiceImpl.class 2KB
Pager.class 2KB
Contact.class 2KB
LoginAction.class 2KB
UserServiceImpl.class 2KB
ContactDaoImpl$2.class 1KB
ContactDaoImpl$1.class 1KB
UserDaoImpl.class 1KB
PagerService.class 969B
User.class 877B
ContactService.class 649B
ContactDao.class 613B
PublicUtil.class 366B
AbstractAction.class 310B
UserService.class 205B
UserDao.class 175B
.classpath 5KB
hibernate3.jar 2.31MB
xwork-2.1.2.jar 2.18MB
com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar 1.57MB
ojdbc14.jar 1.47MB
freemarker-2.3.13.jar 850KB
struts2-core-2.1.6.jar 719KB
org.springframework.context-3.0.1.RELEASE-A.jar 642KB
javassist-3.9.0.GA.jar 583KB
commons-collections-3.1.jar 546KB
org.springframework.beans-3.0.1.RELEASE-A.jar 535KB
org.springframework.web.struts-3.0.1.RELEASE-A.jar 524KB
antlr-2.7.6.jar 433KB
org.springframework.web.servlet-3.0.1.RELEASE-A.jar 389KB
com.springsource.org.apache.log4j-1.2.15.jar 387KB
org.springframework.jdbc-3.0.1.RELEASE-A.jar 369KB
log4j-1.2.14.jar 359KB
org.springframework.web-3.0.1.RELEASE-A.jar 352KB
org.springframework.core-3.0.1.RELEASE-A.jar 347KB
org.springframework.orm-3.0.1.RELEASE-A.jar 324KB
com.springsource.net.sf.cglib-2.2.0.jar 319KB
org.springframework.aop-3.0.1.RELEASE-A.jar 313KB
dom4j-1.6.1.jar 307KB
com.springsource.org.apache.commons.httpclient-3.1.0.jar 301KB
cglib-2.2.jar 272KB
com.springsource.org.codehaus.jackson.mapper-1.0.0.jar 264KB
org.springframework.transaction-3.0.1.RELEASE-A.jar 223KB
ehcache-1.2.3.jar 203KB
org.springframework.web.portlet-3.0.1.RELEASE-A.jar 169KB
ognl-2.6.11.jar 164KB
org.springframework.expression-3.0.1.RELEASE-A.jar 152KB
commons-dbcp-1.2.2.jar 119KB
commons-pool-1.5.4.jar 94KB
persistence.jar 69KB
com.springsource.org.apache.commons.logging-1.1.1.jar 60KB
org.springframework.oxm-3.0.1.RELEASE-A.jar 56KB
com.springsource.org.apache.commons.fileupload-1.2.0.jar 53KB
org.springframework.asm-3.0.1.RELEASE-A.jar 52KB
commons-logging-1.0.4.jar 37KB
org.springframework.aspects-3.0.1.RELEASE-A.jar 29KB
slf4j-api-1.5.8.jar 23KB
jta-1.1.jar 13KB
slf4j-log4j12-1.5.8.jar 9KB
struts2-spring-plugin-2.1.6.jar 9KB
org.springframework.instrument.tomcat-3.0.1.RELEASE-A.jar 5KB
com.springsource.org.aopalliance-1.0.0.jar 5KB
org.springframework.instrument-3.0.1.RELEASE-A.jar 2KB
ContactAction.java 5KB
ContactDaoImpl.java 5KB
ContactServiceImpl.java 2KB
Pager.java 2KB
Contact.java 1KB
LoginAction.java 1KB
UserServiceImpl.java 878B
ContactService.java 796B
ContactDao.java 793B
PagerService.java 766B
UserDaoImpl.java 600B
User.java 475B
UserService.java 181B
UserDao.java 131B
AbstractAction.java 126B
PublicUtil.java 119B
contact_list.jsp 4KB
contact_edit.jsp 2KB
index.jsp 834B
login.jsp 524B
login_success.jsp 353B
error.jsp 288B
MANIFEST.MF 39B
.mymetadata 288B
org.eclipse.core.resources.prefs 186B
.project 1KB
applicationContext-daos.xml 2KB
applicationContext-trans.xml 2KB
applicationContext-beans.xml 2KB
web.xml 1KB
struts.xml 1KB
struts.xml 1KB
Contact.hbm.xml 1KB
Contact.hbm.xml 1KB
User.hbm.xml 654B
共 101 条
- 1
- 2
heroleader
- 粉丝: 57
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页