• 大小: 13.36MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-16
  • 语言: 其他
  • 标签:

资源简介

唐诗学习网站(代码)

资源截图

代码片段和文件信息

package action;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionContext;

import dao.AuthorDao;
import domain.Author;
import domain.Poem;

public class AuthorAction {
private Author author;
private AuthorDao authorDao;
private List poems;
private List authors;

public Author getAuthor() {
return author;
}

public void setAuthor(Author author) {
this.author = author;
}

public List getPoems() {
return poems;
}

public void setPoems(List poems) {
this.poems = poems;
}

public AuthorDao getAuthorDao() {
return authorDao;
}

public void setAuthorDao(AuthorDao authorDao) {
this.authorDao = authorDao;
}

public List getAuthors() {
return authors;
}

public void setAuthors(List authors) {
this.authors = authors;
}

public String index() {
authors = authorDao.queryAll();
return “index“;
}

// 显示作者个人信息
public String show() {
author = authorDao.findByAid(author);
poems = new ArrayList(author.getPoems());
System.out.println(“size in action: “ + poems.size());
return “show“;
}

public String edit() {
author = authorDao.findByAid(author);
return “edit“;
}

// 添加诗人信息
public String add() {
if (authorDao.findByName(author.getName()) != null) {
ActionContext.getContext().getSession()
.put(“author“ “sorry,该作者已存在!“);
return “add“;
}
authorDao.insertAuthor(author);
ActionContext.getContext().getSession().put(“author“ null);
return index();
}

// 更新诗人信息
public String update() {
authorDao.updateAuthor(author);
author = authorDao.findByAid(author);
return show();
}

public String delete() {
authorDao.delete(author);
return index();
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-02-21 15:51  poem\
     文件        1046  2012-12-16 04:35  poem\.classpath
     文件         312  2012-11-27 02:24  poem\.gitignore
     文件        1037  2012-12-06 20:13  poem\.project
     目录           0  2013-01-11 22:18  poem\.settings\
     文件         503  2012-11-26 01:02  poem\.settings\.jsdtscope
     文件         116  2013-01-09 20:42  poem\.settings\org.eclipse.core.resources.prefs
     文件         395  2012-11-26 01:02  poem\.settings\org.eclipse.jdt.core.prefs
     文件         442  2012-12-06 20:13  poem\.settings\org.eclipse.wst.common.component
     文件         345  2012-11-26 01:02  poem\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2012-11-26 01:02  poem\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2012-11-26 01:02  poem\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2013-01-11 22:18  poem\WebContent\
     目录           0  2013-01-11 22:18  poem\WebContent\meta-INF\
     文件          39  2012-11-26 01:02  poem\WebContent\meta-INF\MANIFEST.MF
     目录           0  2013-01-11 22:18  poem\WebContent\WEB-INF\
     文件        3293  2012-12-16 03:31  poem\WebContent\WEB-INF\applicationContext.xml
     目录           0  2013-01-11 22:18  poem\WebContent\WEB-INF\lib\
     文件      443432  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\antlr-2.7.6.jar
     文件      559366  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\commons-collections-3.1.jar
     文件      121757  2012-10-25 16:12  poem\WebContent\WEB-INF\lib\commons-dbcp.jar
     文件       59590  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\commons-fileupload-1.2.2.jar
     文件      159509  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\commons-io-2.0.1.jar
     文件      279193  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\commons-lang-2.5.jar
     文件       60841  2012-10-25 15:41  poem\WebContent\WEB-INF\lib\commons-logging.jar
     文件       62103  2012-10-25 16:12  poem\WebContent\WEB-INF\lib\commons-pool.jar
     文件      313898  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\dom4j-1.6.1.jar
     文件      924269  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\freemarker-2.3.18.jar
     文件      102661  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar
     文件     4162825  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\hibernate3.jar
     文件      614203  2012-10-25 15:40  poem\WebContent\WEB-INF\lib\javassist-3.11.0.GA.jar
............此处省略124个文件信息

评论

共有 条评论

相关资源