资源简介
spring+struts2+hibernate,风景网(增删改查,收藏发帖,前台后台)源代码+数据库,jdk7+mysql,可运行,十多张表,适合j2ee课设毕设
代码片段和文件信息
package com.view.action;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.opensymphony.xwork2.ActionContext;
import com.view.pojo.Introduce;
import com.view.pojo.Share;
import com.view.pojo.User;
import com.view.service.IntroduceService;
import com.view.service.ShareService;
import com.view.service.UserService;
/**
* 收藏
* @author Administrator
*
*/
public class CollectionAction extends HibernateDaoSupport{
private UserService userService = null;
private IntroduceService introduceService = null;
private ShareService shareService = null;
private int id;
private int iid;
private String iname;
public String getIname() {
return iname;
}
public void setIname(String iname) {
this.iname = iname;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getIid() {
return iid;
}
public void setIid(int iid) {
this.iid = iid;
}
public int getid() {
return id;
}
public void setSid(int id) {
this.id = id;
}
public ShareService getShareService() {
return shareService;
}
public void setShareService(ShareService shareService) {
this.shareService = shareService;
}
public IntroduceService getIntroduceService() {
return introduceService;
}
public void setIntroduceService(IntroduceService introduceService) {
this.introduceService = introduceService;
}
public UserService getUserService() {
return userService;
}
public void setUserService(UserService userService) {
this.userService = userService;
}
/**
* 获取景区收藏列表
* @return
*/
@SuppressWarnings(“unchecked“)
public String getCollIntrList(){
Mapject> session = ActionContext.getContext().getSession();
//根据id获取用户的
int userid = ((User)session.get(“current“)).getUid();
User user = userService.getUser(userid);
Set set = user.getIntroduces();
List list = new ArrayList();
for(Introduce obj : set){
list.add(obj);
}
session.put(“collintrs“ list);
return “success“;
}
/**
* 获取用户分享收藏列表
* @return
*/
public String getCollShareList(){
Mapject> session = ActionContext.getContext().getSession();
int userid = ((User)session.get(“current“)).getUid();
User user = userService.getUser(userid);
Set set = user.getShares();
List shares = new ArrayList();
for(Share obj : set){
shares.add(obj);
}
System.out.println(“收藏列表长度:“+shares.size());
ActionContext.getContext().getSession().put(“collshares“ shares);
return “success“;
}
/**
* 增加景区收藏
* @return
*/
public String addColIntr(){
Mapject> session = ActionContext.getContext().getSession();
Introduce c
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 833 2017-03-08 16:41 ssh\Scenery\.classpath
文件 1040 2017-03-08 16:41 ssh\Scenery\.project
文件 567 2017-03-08 16:41 ssh\Scenery\.settings\.jsdtscope
文件 224 2017-05-16 18:34 ssh\Scenery\.settings\org.eclipse.core.resources.prefs
文件 364 2017-03-08 16:41 ssh\Scenery\.settings\org.eclipse.jdt.core.prefs
文件 449 2017-04-08 16:26 ssh\Scenery\.settings\org.eclipse.wst.common.component
文件 345 2017-03-08 16:41 ssh\Scenery\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-03-08 16:41 ssh\Scenery\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-03-08 16:41 ssh\Scenery\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 5636 2017-05-19 15:28 ssh\Scenery\build\classes\applicationContext.xm
文件 6127 2018-01-23 21:19 ssh\Scenery\build\classes\com\view\action\CollectionAction.class
文件 6822 2018-01-23 22:20 ssh\Scenery\build\classes\com\view\action\CommentAction.class
文件 2082 2018-01-23 21:21 ssh\Scenery\build\classes\com\view\action\IndexAction.class
文件 8309 2018-01-23 22:20 ssh\Scenery\build\classes\com\view\action\IntroduceAction.class
文件 2981 2018-01-23 22:20 ssh\Scenery\build\classes\com\view\action\RecommendAction.class
文件 1653 2018-01-23 21:22 ssh\Scenery\build\classes\com\view\action\RegisterAction.class
文件 8367 2018-01-23 21:22 ssh\Scenery\build\classes\com\view\action\ShareAction.class
文件 4297 2018-01-23 22:20 ssh\Scenery\build\classes\com\view\action\ShareContentAction.class
文件 918 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\action\StartUpServlet.class
文件 1415 2018-01-23 22:20 ssh\Scenery\build\classes\com\view\action\TypeAction.class
文件 6324 2018-01-23 22:20 ssh\Scenery\build\classes\com\view\action\UserAction.class
文件 331 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\AdminUserDao.class
文件 544 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\ba
文件 2940 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\ba
文件 272 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\CityDao.class
文件 669 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\CommentDao.class
文件 1382 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\impl\AdminUserDaoImpl.class
文件 1188 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\impl\CityDaoImpl.class
文件 2923 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\impl\CommentDaoImpl.class
文件 3842 2018-01-23 20:00 ssh\Scenery\build\classes\com\view\dao\impl\IntroduceDaoImpl.class
............此处省略776个文件信息
评论
共有 条评论