?? removemessageaction.java
字號:
/*
* 創建日期 2006-4-8
*
* TODO 要更改此生成的文件的模板,請轉至
* 窗口 - 首選項 - Java - 代碼樣式 - 代碼模板
*/
package bit.jeffy.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import bit.jeffy.db.DataStore;
/**
* @author jeffy
*
* TODO 要更改此生成的類型注釋的模板,請轉至
* 窗口 - 首選項 - Java - 代碼樣式 - 代碼模板
*/
public class RemoveMessageAction extends Action {
/* (非 Javadoc)
* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public ActionForward execute(ActionMapping map, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
// TODO 自動生成方法存根
ActionErrors errors = new ActionErrors();
String s = request.getParameter("mid");
int mid = Integer.parseInt(s);
if(mid < 0) {
errors.add("faild_1",new ActionError("RemoveMessageAction.a"));
saveErrors(request,errors);
return (map.findForward("removefail"));
}
String sql = "delete from clientmessage where ID='"+mid+"'";
DataStore ds = DataStore.getInstance();
try {
ds.execute(sql);
}catch(Exception e) {
errors.add("faild_2",new ActionError("RemoveMessageAction.b"));
saveErrors(request,errors);
return (map.findForward("removefail"));
}
request.setAttribute("view","3");
return (map.findForward("removeok"));
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -