首页>代码>S2SH框架整合实现开源博客系统>/博客网站系统/JavaPrj_4/src/com/sanqing/action/EditBlogInfo.java
package com.sanqing.action;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.sanqing.po.BlogInfo;
import com.sanqing.service.BlogInfoService;

public class EditBlogInfo extends ActionSupport {
	private String blogtitle;
	private String idiograph;
	private BlogInfoService blogInfoService;

	public BlogInfoService getBlogInfoService() {
		return blogInfoService;
	}

	public void setBlogInfoService(BlogInfoService blogInfoService) {
		this.blogInfoService = blogInfoService;
	}

	public String getBlogtitle() {
		return blogtitle;
	}

	public void setBlogtitle(String blogtitle) {
		this.blogtitle = blogtitle;
	}

	public String getIdiograph() {
		return idiograph;
	}

	public void setIdiograph(String idiograph) {
		this.idiograph = idiograph;
	}

	public String execute() throws Exception {
//		//获得request
//		HttpServletRequest request = ServletActionContext.getRequest();
//		//获得session
//		HttpSession session =request.getSession();
//		//获得username
//		String username = (String) session.getAttribute("username");
		
		Map session = ActionContext.getContext().getSession();
		String username = (String) session.get("username");
		
		BlogInfo blogInfo = new BlogInfo();
		//设置用户名
		blogInfo.setUsername(username);
		//设置博客标题
		blogInfo.setBlogtitle(blogtitle);
		//设置个性签名
		blogInfo.setIdiograph(idiograph);
		//调用业务逻辑组件来完成设置
		blogInfoService.setBlogInfo(blogInfo);
		
		return this.SUCCESS;
	}

}
最近下载更多
奋斗的小蚂蚁  LV17 10月22日
lsglsg9  LV23 2021年9月8日
听雨轩丿  LV10 2021年7月8日
wanglinddad  LV55 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日
最近浏览更多
t_heyao 11月18日
暂无贡献等级
奋斗的小蚂蚁  LV17 10月17日
6418368  LV10 8月16日
tokiiii  LV2 2月4日
lvyga1  LV2 2024年12月17日
唐僧洗头爱飘柔  LV22 2024年4月16日
赵明磊 2024年1月18日
暂无贡献等级
LARY  LV1 2024年1月5日
1140717565  LV2 2023年12月29日
wiston 2023年11月26日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友