⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 updatecontentaction.java

📁 这个程序是花了好几十万请人开发的
💻 JAVA
字号:
// Created by Xslt generator for Eclipse.// XSL :  not found (java.io.FileNotFoundException:  (系统找不到指定的路径。))// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xslpackage struts.action;import java.sql.*;import javabean.*;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;/**  * UpdatecontentAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 11-12-2003 *  * XDoclet definition: * @struts:action validate="true" * @struts:action-forward name="/update.jsp" path="/update.jsp" * @struts:action-forward name="/updatetitle.jsp" path="/updatetitle.jsp" */public class UpdatecontentAction extends Action {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods	/** 	 * Method execute	 * @param ActionMapping mapping	 * @param ActionForm form	 * @param HttpServletRequest request	 * @param HttpServletResponse response	 * @return ActionForward	 * @throws Exception	 */	public ActionForward execute(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws Exception {//			初始化缓冲池,获得对数据库的连接		ConnectionPool pool=null;		pool=ConnectionPool.getInstance();		Connection con=null;		Statement sql=null;		ResultSet rs=null;		try		{			con=pool.getConnection();		}		catch(SQLException e){}		String flag=request.getParameter("flag").trim();		String code=request.getParameter("code").trim();		String message="";		if(flag.equals("title"))		{			try			{				sql=con.createStatement();				String str="select message from luntan1 where code="+code;				rs=sql.executeQuery(str);				if(rs.next())					message=rs.getString("message");			}			catch(SQLException e){}			request.setAttribute("code",code);			request.setAttribute("message",message);			try			{				if(con!=null) 				con.close();			}					catch(SQLException e){}			return mapping.findForward("title");					}		else		{			String id="";			try			{				id=request.getParameter("id").trim();				sql=con.createStatement();				String str="select message from luntan2 where code="+code+" and id="+id;				rs=sql.executeQuery(str);				while(rs.next())					message=rs.getString("message");			}			catch(SQLException e){}			request.setAttribute("code",code);			request.setAttribute("id",id);			request.setAttribute("message",message);			try			{				if(con!=null) 				con.close();			}			catch(SQLException e){}			return mapping.findForward("huifu");		}			}}

⌨️ 快捷键说明

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