📄 mmseditupdatesubjectmemo.java
字号:
/*
* Created on 2005-8-4
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.rainbow.mms.manage;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.opensymphony.webwork.ServletActionContext;
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionSupport;
import com.rainbow.mms.common.MmsContent;
import com.rainbow.mms.common.MmsSmilPageUnitCollection;
import com.rainbow.util.tools.HibernateUtil;
/**
* 更新彩信内容体的主题和描述
* @author Rainbow MMS Group Leader —— TrWorks
*/
public class MmsEditUpdateSubjectMemo extends ActionSupport {
private static final long serialVersionUID = 1L;
private Logger log = Logger.getLogger(MmsEditUpdateSubjectMemo.class);
public String execute() throws Exception {
String subject = ServletActionContext.getRequest().getParameter("mmsSubject");
String memo = ServletActionContext.getRequest().getParameter("mmsMemo");
subject = new String(subject.getBytes("iso8859-1"), "GBK");
memo = new String(memo.getBytes("iso-8859-1"), "GBK");
MmsSmilPageUnitCollection collection =
(MmsSmilPageUnitCollection)ActionContext.getContext().getSession().get("mmsPageMapCollection");
if (collection == null){
log.error("MmsEditUpdateSubjectMemo execute function input param mmsPageMapCollection is null.");
return ERROR;
}
MmsContent content = (MmsContent)collection.getOrgMmsContent();
content.setSubject(subject);
content.setCreaterMemo(memo);
String result = ERROR;
try{
Session sess = HibernateUtil.currentSession();
Transaction tx = sess.beginTransaction();
sess.update(content);
tx.commit();
result = SUCCESS;
}
catch(Exception e){
e.printStackTrace();
result = ERROR;
}
finally{
HibernateUtil.closeSession();
}
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -