首页>代码>S2SH(spring+struts2+hibernate)整合开发java web开源个人博客系统源码>/Blog/src/com/blog/action/article/ArticleDetailAction.java
package com.blog.action.article;


import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.blog.entity.Article;
import com.blog.service.ArticleService;


@Controller@Scope("prototype")
public class ArticleDetailAction {
	@Resource ArticleService articleServiceImpl;
	private Integer id;
	private Article article;
	private Article articleBefore;
	private Article articleAfter;
	
	public String execute(){
		articleBefore = articleServiceImpl.queryBefore(id);
		articleAfter = articleServiceImpl.queryAfter(id);
		article = articleServiceImpl.query(id);
		Integer count = article.getCount();
		if(count==null){
			count=0;
		}
		count++;
		article.setCount(count);
		articleServiceImpl.update(article);
		return "success";
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

	public Article getArticleBefore() {
		return articleBefore;
	}

	public void setArticleBefore(Article articleBefore) {
		this.articleBefore = articleBefore;
	}

	public Article getArticleAfter() {
		return articleAfter;
	}

	public void setArticleAfter(Article articleAfter) {
		this.articleAfter = articleAfter;
	}

	
}
最近下载更多
wanglinddad  LV54 2022年5月10日
云生123456  LV6 2022年3月24日
dcdc12  LV6 2021年12月21日
lekers  LV14 2021年12月16日
lsglsg9  LV22 2021年9月8日
ceelf48  LV6 2021年7月13日
shishizhouzhou  LV12 2021年6月15日
XcHyxa  LV7 2021年6月9日
15525425383  LV6 2021年5月23日
1207748096  LV6 2021年5月12日
最近浏览更多
空中飞尘  LV13 2023年12月13日
abandan  LV4 2023年11月6日
和鱼崽  LV6 2023年10月2日
tangyongheng08  LV6 2023年7月21日
三十一  LV2 2023年6月28日
li951753  LV2 2023年6月19日
微信网友_6477647054655488  LV2 2023年6月1日
13133117021  LV4 2023年5月31日
mishidelu 2023年5月26日
暂无贡献等级
899558  LV1 2023年4月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友