updateguestbookaction.java

来自「用于进行书写定单的源代码.请各位一定要好好研究」· Java 代码 · 共 59 行

JAVA
59
字号
package com.enlen.book;

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 com.uniland.common.CallService;
import com.uniland.dao.DaoParam;
import com.uniland.dao.RowSet;
import com.uniland.knowledge.ModifyLogForm;

public class UpdateGuestBookAction extends Action {

	/**
	* Constructor
	*/
	public UpdateGuestBookAction() {

		super();

	}
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
		ActionErrors errors = new ActionErrors();
		ActionForward forward = new ActionForward();
		 //RowSet rs = ( (UpdateGuestBookForm) form).getRowSet();
    	// request.setAttribute("guestbook",rs);
		
        try {
        	DaoParam sver=new DaoParam();
			String Sql = "";
           String title = request.getParameter("title");
           String text = request.getParameter("text");
           String oper = request.getParameter("oper");
           String other = request.getParameter("other");
           text =new String (text.getBytes("iso-8859-1"),"gb2312");
           title =new String (title.getBytes("iso-8859-1"),"gb2312");
           
        	Sql = "UPDATE guestbook SET other='" + other + "' ,title='" + title + "' , text='" + text + "'";
            Sql += " WHERE id = '" + request.getParameter("id")+"'";
           CallService.getDao().runSQL(Sql);
            
        }catch(Exception e)
		{
			e.getStackTrace();
		}
		return mapping.findForward("success");
        }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?