首页>代码>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;
	}

	
}
最近下载更多
15828038591  LV11 2025年12月17日
wanglinddad  LV55 2022年5月10日
云生123456  LV6 2022年3月24日
dcdc12  LV6 2021年12月21日
lekers  LV14 2021年12月16日
lsglsg9  LV23 2021年9月8日
ceelf48  LV6 2021年7月13日
shishizhouzhou  LV12 2021年6月15日
XcHyxa  LV7 2021年6月9日
15525425383  LV6 2021年5月23日
最近浏览更多
Osit888  LV12 昨天
15828038591  LV11 2025年12月17日
t_heyao 2025年11月18日
暂无贡献等级
1140717565  LV2 2025年7月18日
nightstarshii 2025年1月26日
暂无贡献等级
krispeng  LV15 2024年11月20日
WBelong  LV8 2024年9月20日
微信网友_6906962132258816  LV7 2024年5月15日
空中飞尘  LV13 2023年12月13日
abandan  LV4 2023年11月6日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友