唐诗学习网站代码


唐诗学习网站(代码)
资源截图
代码片段和文件信息
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.settingsorg.eclipse.core.resources.prefs
     文件         395  2012-11-26 01:02  poem.settingsorg.eclipse.jdt.core.prefs
     文件         442  2012-12-06 20:13  poem.settingsorg.eclipse.wst.common.component
     文件         345  2012-11-26 01:02  poem.settingsorg.eclipse.wst.common.project.facet.core.xml
     文件          49  2012-11-26 01:02  poem.settingsorg.eclipse.wst.jsdt.ui.superType.container
     文件           6  2012-11-26 01:02  poem.settingsorg.eclipse.wst.jsdt.ui.superType.name
     目录           0  2013-01-11 22:18  poemWebContent
     目录           0  2013-01-11 22:18  poemWebContentmeta-INF
     文件          39  2012-11-26 01:02  poemWebContentmeta-INFMANIFEST.MF
     目录           0  2013-01-11 22:18  poemWebContentWEB-INF
     文件        3293  2012-12-16 03:31  poemWebContentWEB-INFapplicationContext.xml
     目录           0  2013-01-11 22:18  poemWebContentWEB-INFlib
     文件      443432  2012-10-25 15:40  poemWebContentWEB-INFlibantlr-2.7.6.jar
     文件      559366  2012-10-25 15:40  poemWebContentWEB-INFlibcommons-collections-3.1.jar
     文件      121757  2012-10-25 16:12  poemWebContentWEB-INFlibcommons-dbcp.jar
     文件       59590  2012-10-25 15:40  poemWebContentWEB-INFlibcommons-fileupload-1.2.2.jar
     文件      159509  2012-10-25 15:40  poemWebContentWEB-INFlibcommons-io-2.0.1.jar
     文件      279193  2012-10-25 15:40  poemWebContentWEB-INFlibcommons-lang-2.5.jar
     文件       60841  2012-10-25 15:41  poemWebContentWEB-INFlibcommons-logging.jar
     文件       62103  2012-10-25 16:12  poemWebContentWEB-INFlibcommons-pool.jar
     文件      313898  2012-10-25 15:40  poemWebContentWEB-INFlibdom4j-1.6.1.jar
     文件      924269  2012-10-25 15:40  poemWebContentWEB-INFlibfreemarker-2.3.18.jar
     文件      102661  2012-10-25 15:40  poemWebContentWEB-INFlibhibernate-jpa-2.0-api-1.0.1.Final.jar
     文件     4162825  2012-10-25 15:40  poemWebContentWEB-INFlibhibernate3.jar
     文件      614203  2012-10-25 15:40  poemWebContentWEB-INFlibjavassist-3.11.0.GA.jar
............此处省略124个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)