資源簡介
替別人寫的畢設一部分。ssh2寫的。框架比較老,但是新手看看還是不錯的
代碼片段和文件信息
package?action;
import?java.util.Date;
import?java.util.List;
import?po.Comment;
import?po.Product;
import?po.User;
import?vo.PageBean;
import?biz.ICommentBiz;
import?biz.IProductBiz;
import?com.opensymphony.xwork2.ActionContext;
import?com.opensymphony.xwork2.ActionSupport;
import?com.opensymphony.xwork2.ModelDriven;
import?com.opensymphony.xwork2.Preparable;
public?class?CommentAction?extends?ActionSupport?implements
ModelDriven?Preparable?{
private?Comment?comment;
private?ICommentBiz?commentbiz;
private?IProductBiz?productbiz;
private?int?currentPage?=?1;
private?int?pageSize?=?10;
private?int?pid;
private?int?fathercid;
public?void?setFathercid(int?fathercid)?{
this.fathercid?=?fathercid;
}
public?void?setProductbiz(IProductBiz?productbiz)?{
this.productbiz?=?productbiz;
}
public?void?setPid(int?pid)?{
this.pid?=?pid;
}
public?void?setCurrentPage(int?currentPage)?{
this.currentPage?=?currentPage;
}
public?void?setPageSize(int?pageSize)?{
this.pageSize?=?pageSize;
}
public?void?setComment(Comment?comment)?{
this.comment?=?comment;
}
public?void?setCommentbiz(ICommentBiz?commentbiz)?{
this.commentbiz?=?commentbiz;
}
@Override
public?void?prepare()?throws?Exception?{
//?TODO?Auto-generated?method?stub
this.comment?=?new?Comment();
}
@Override
public?Comment?getModel()?{
//?TODO?Auto-generated?method?stub
return?this.comment;
}
public?String?findByMine()?throws?Exception?{
ActionContext?ac?=?ActionContext.getContext();
User?a?=?(User)?ac.getSession().get(“account“);
int?id?=?a.getUid();
PageBean?pb?=?this.commentbiz.findByMine(currentPage?pageSize?id);
ac.put(“comment“?pb);
return?null;
}
public?String?add()?throws?Exception?{
ActionContext?ac?=?ActionContext.getContext();
User?u?=?(User)?ac.getSession().get(“account“);
if?(u?==?null)?{
return?“loginerror“;
}?else?{
int?id?=?u.getUid();
String?name?=?u.getName();
Date?now?=?new?Date();
this.comment.setUserid(id);
this.comment.setUsername(name);
this.comment.setTime(now);
this.comment.setFcid(0);
this.comment.setGood(0);
this.comment.setNormal(0);
this.comment.setBad(0);
this.commentbiz.add(this.comment);
ac.put(“pid“?this.comment.getProductid());
int?role?=?u.getRole();
if?(role?==?1)?{
return?“jump“;
}?else?{
return?“adminjump“;
}
}
}
//?商品顯示
public?String?showByPid()?throws?Exception?{
ActionContext?ac?=?ActionContext.getContext();
User?u?=?(User)?ac.getSession().get(“account“);
if?(u?==?null)?{
return?“loginerror“;
}?else?{
Product?p?=?this.productbiz.findById(this.pid);
PageBean?c?=?this.commentbiz.findByPid(currentPage?5?this.pid);
List?lstc?=?this.commentbiz.findByPid(pid);
int[]?score?=?{?0?0?0?0?0?0?};
for?(int?i?=?0;?i?
if?(lstc.get(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3735??2012-05-09?13:33??shop\.classpath
?????文件????????541??2012-05-22?01:40??shop\.myhibernatedata
?????文件????????285??2012-05-09?12:04??shop\.myme
?????文件????????240??2012-05-09?12:15??shop\.mystrutsdata
?????文件???????2240??2012-05-09?12:23??shop\.project
?????文件????????493??2012-05-09?12:04??shop\.settings\.jsdtscope
?????文件????????200??2012-05-23?13:16??shop\.settings\com.genuitec.eclipse.core.prefs
?????文件????????395??2012-05-09?12:04??shop\.settings\org.eclipse.jdt.core.prefs
?????文件????????450??2012-05-09?12:04??shop\.settings\org.eclipse.wst.common.component
?????文件????????252??2012-05-09?12:04??shop\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2012-05-09?12:04??shop\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2012-05-09?12:04??shop\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????474??2012-05-09?12:21??shop\.springBeans
?????文件???????6682??2012-05-22?23:41??shop\src\action\CommentAction.java
?????文件???????9339??2012-05-23?13:12??shop\src\action\ProductAction.java
?????文件???????3930??2012-05-13?09:43??shop\src\action\UserAction.java
?????文件????????749??2012-05-13?10:38??shop\src\biz\ICommentBiz.java
?????文件???????2221??2012-05-13?10:40??shop\src\biz\impl\CommentBizImpl.java
?????文件???????1240??2012-05-13?10:16??shop\src\biz\impl\ProductBizImpl.java
?????文件???????1537??2012-05-10?14:24??shop\src\biz\impl\UserBizImpl.java
?????文件????????451??2012-05-13?10:16??shop\src\biz\IProductBiz.java
?????文件????????566??2012-05-10?14:23??shop\src\biz\IUserBiz.java
?????文件???????3127??2012-05-09?12:27??shop\src\dao\ba
?????文件????????712??2012-05-09?12:27??shop\src\dao\ba
?????文件????????143??2012-05-09?12:31??shop\src\dao\ICommentDao.java
?????文件????????216??2012-05-09?12:33??shop\src\dao\impl\CommentDaoImpl.java
?????文件????????216??2012-05-09?12:34??shop\src\dao\impl\ProductDaoImpl.java
?????文件????????201??2012-05-09?12:35??shop\src\dao\impl\UserDaoImpl.java
?????文件????????143??2012-05-09?12:32??shop\src\dao\IProductDao.java
?????文件????????134??2012-05-09?12:30??shop\src\dao\IUserDao.java
............此處省略273個文件信息
- 上一篇:數字電子技術基礎 第五版-閻石完整中文版 清晰
- 下一篇:新手入門必看的硬件設計資料
評論
共有 條評論