package com.joe.bms.web.action;
import java.util.List;
import javax.annotation.Resource;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import com.joe.bms.persistence.entity.Book;
import com.joe.bms.service.BookService;
import com.opensymphony.xwork2.ActionSupport;
/**
* BookAction
* @author joe.qiu
* @date 2011-10-5下午10:05:43
* @version 1.0.0
*/
@Namespace("/book")
@Results({
@Result(name="redirect_index",type="redirect",location="index.do")
})
public class BookAction extends ActionSupport {
private static final long serialVersionUID = 1L;
@Resource
private BookService bookService;
private Book item;
private Integer id;
private List<Book> books;
@Action("index")
public String index(){
books=this.bookService.findAll();
return "index";
}
@Action("build")
public String build(){
return "build";
}
@Action("save")
public String save(){
this.bookService.create(item);
return "redirect_index";
}
@Action("edit")
public String edit(){
item=this.bookService.find(id);
return "edit";
}
public Book getItem() {
return item;
}
public void setItem(Book item) {
this.item = item;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public List<Book> getBooks() {
return books;
}
public void setBooks(List<Book> books) {
this.books = books;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
bms.zip (88个子文件)
bms
.settings
org.eclipse.jdt.core.prefs 330B
.project 1KB
main
webapp
META-INF
MANIFEST.MF 39B
WEB-INF
web.xml 1KB
views
book
edit.ftl 0B
index.ftl 671B
build.ftl 717B
classes
mybatis-config.xml 711B
logback.xml 1KB
jdbc.properties 363B
com
joe
bms
persistence
mapper
BookMapper.xml 739B
BookMapper.class 299B
entity
Book.class 888B
core
EntityService.class 2KB
EntityMapper.class 510B
test
SpringTest.class 1KB
web
action
BookAction.class 2KB
service
BookService.class 913B
struts.xml 2KB
freemarker.properties 159B
xwork-conversion.properties 60B
struts.properties 160B
applicationContext.xml 4KB
lib
org.springframework.aop-3.0.6.RELEASE.jar 314KB
org.springframework.instrument.tomcat-3.0.6.RELEASE.jar 6KB
org.springframework.web-3.0.6.RELEASE.jar 389KB
ehcache-core-2.4.4.jar 986KB
c3p0-0.9.1.2.jar 596KB
javassist-3.12.0.GA.jar 618KB
org.springframework.asm-3.0.6.RELEASE.jar 52KB
org.springframework.jms-3.0.6.RELEASE.jar 181KB
aopalliance-1.0.jar 4KB
ognl-3.0.1.jar 224KB
asm-3.1.jar 42KB
commons-beanutils-1.8.3.jar 227KB
org.springframework.aspects-3.0.6.RELEASE.jar 35KB
cglib-2.2.jar 272KB
mybatis-ehcache-1.0.0.jar 10KB
commons-fileupload.jar 52KB
ezmorph-1.0.3.jar 76KB
slf4j-api-1.6.1.jar 25KB
struts2-spring-plugin-2.2.3.jar 21KB
commons-lang-2.6.jar 278KB
org.springframework.test-3.0.6.RELEASE.jar 200KB
mybatis-3.0.5.jar 620KB
org.springframework.web.struts-3.0.6.RELEASE.jar 31KB
freemarker-2.3.16.jar 860KB
jcl-over-slf4j-1.6.1.jar 17KB
org.springframework.jdbc-3.0.6.RELEASE.jar 377KB
org.springframework.expression-3.0.6.RELEASE.jar 166KB
org.springframework.instrument-3.0.6.RELEASE.jar 2KB
org.springframework.web.servlet-3.0.6.RELEASE.jar 410KB
logback-core-0.9.29.jar 308KB
mybatis-spring-1.0.1.jar 34KB
org.springframework.orm-3.0.6.RELEASE.jar 327KB
commons-collections-3.2.jar 558KB
org.springframework.transaction-3.0.6.RELEASE.jar 226KB
org.springframework.context.support-3.0.6.RELEASE.jar 99KB
logback-classic-0.9.29.jar 238KB
xwork-core-2.2.3.jar 602KB
struts2-convention-plugin-2.2.3.jar 64KB
commons-io-1.3.2.jar 86KB
org.springframework.beans-3.0.6.RELEASE.jar 544KB
asm-commons-3.1.jar 32KB
mysql-connector-java-5.1.18-bin.jar 771KB
org.springframework.web.portlet-3.0.6.RELEASE.jar 172KB
org.springframework.oxm-3.0.6.RELEASE.jar 60KB
org.springframework.core-3.0.6.RELEASE.jar 373KB
org.springframework.context-3.0.6.RELEASE.jar 655KB
struts2-core-2.2.3.jar 756KB
test
com
joe
bms
test
SpringTest.java 739B
resources
mybatis-config.xml 711B
logback.xml 1KB
jdbc.properties 216B
com
joe
bms
persistence
mapper
BookMapper.xml 739B
struts.xml 2KB
freemarker.properties 159B
xwork-conversion.properties 60B
struts.properties 160B
applicationContext.xml 4KB
java
com
joe
bms
persistence
mapper
BookMapper.java 299B
entity
Book.java 521B
core
EntityService.java 692B
EntityMapper.java 408B
web
action
BookAction.java 2KB
service
BookService.java 566B
.mymetadata 286B
.classpath 5KB
.myeclipse
共 88 条
- 1
资源评论
- wbj20082013-03-07有参考价值 ,值得学习 一下。。
- rose1rose2014-06-26不错,值得学习。
- luoyzh2013-03-21不错对我来说还是复杂了点
仲成
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功