package com.sanqing.action; import java.util.Date; import java.util.Map; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.sanqing.po.Article; import com.sanqing.service.ArticleService; public class AddArticle extends ActionSupport { private String title; private String content; private ArticleService articleService; public ArticleService getArticleService() { return articleService; } public void setArticleService(ArticleService articleService) { this.articleService = articleService; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String execute() throws Exception { Map session = ActionContext.getContext().getSession(); String username = (String) session.get("username"); //封装一个PO类的对象 Article article = new Article(); article.setTitle(title); article.setContent(content); article.setUsername(username); article.setDate(new Date()); article.setHasread(0); articleService.addArticle(article); return this.SUCCESS; } }
最近下载更多
lsglsg9 LV22
2021年9月8日
听雨轩丿 LV10
2021年7月8日
wanglinddad LV54
2021年7月3日
dfffwq LV3
2021年6月29日
SOLEIL. LV3
2021年6月23日
rongfan LV14
2021年4月5日
kkdxxny LV1
2021年1月4日
死神的沉落 LV10
2020年10月13日
你为我着迷丶 LV18
2020年7月13日
1515355665 LV7
2020年6月22日
最近浏览更多
唐僧洗头爱飘柔 LV22
4月16日
赵明磊
1月18日
暂无贡献等级
LARY LV1
1月5日
1140717565 LV2
2023年12月29日
wiston
2023年11月26日
暂无贡献等级
最代码的苏拉
2023年9月20日
暂无贡献等级
zhaobing_g LV3
2023年8月28日
15124365605
2023年7月31日
暂无贡献等级
tangyongheng08 LV6
2023年7月21日
微信网友_6525855162486784
2023年6月19日
暂无贡献等级