📄 updateshenqingaction.java
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xslpackage com.yourcompany.struts.action;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;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 org.apache.struts.action.ActionMessage;import admin.DataControl;public class UpdateshenqingAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ActionErrors err = new ActionErrors(); try{ request.setCharacterEncoding("GBK"); System.out.println(""); System.out.println("开始updateshenqingaction"); String dept = request.getParameter("dept"); System.out.println(dept); String id = request.getParameter("id"); System.out.println(id); String timea = request.getParameter("timea"); System.out.println(timea); String FCKeditor1s[] = request.getParameterValues("FCKeditor1"); String FCKeditor1 = ""; for (int x = 0; x < FCKeditor1s.length; x++) { FCKeditor1 = FCKeditor1+FCKeditor1s[x]; } System.out.println(FCKeditor1.length()); if(FCKeditor1.length()>8000){ err.add("err",new ActionMessage("shenqing.update.error","申请内容不得大于8000字")); this.saveErrors(request,err); return mapping.getInputForward(); } FCKeditor1 = FCKeditor1.replace("'","''"); System.out.println("titles.length: "+FCKeditor1s.length); System.out.println(FCKeditor1); String title = request.getParameter("title"); title = title.replace("'","''"); System.out.println(title); DataControl data = new DataControl(); String sql = "update shenqing set timea='"+timea+"',title='"+title+"',content='"+FCKeditor1+"' where id="+id; System.out.println(sql); int i = data.getInsert(sql); System.out.println(i); }catch(Exception e){ System.out.println("修改申请失败"+e.getStackTrace()); err.add("err",new ActionMessage("shenqing.update.error","申请修改失败")); this.saveErrors(request,err); return mapping.getInputForward(); } return mapping.findForward("updateok"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -