📄 ylhq1_dtps_d1action.java
字号:
// Created by Xslt generator for Eclipse.// XSL : not found (java.io.FileNotFoundException: (Bad file descriptor))// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xslpackage struts.action;import java.sql.ResultSet;import java.util.Vector;import javabean.Sctj;import javabean.dbconnect;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;import struts.form.Ylhq1_dtps_d1Form;/** * Ylhq1_dtps_d1Action.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 10-20-2004 * * XDoclet definition: * @struts:action path="/ylhq1_dtps_d1" name="ylhq1_dtps_d1Form" input="/ylhq1_dtps_d1.jsp" validate="true" */public class Ylhq1_dtps_d1Action 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 { Ylhq1_dtps_d1Form ylhq1_dtps_d1Form = (Ylhq1_dtps_d1Form) form; ResultSet rs; dbconnect db=new dbconnect(); String sql; String table=ylhq1_dtps_d1Form.gettable(); String table1="YLHQ1_DT_TP"; String contents=""; String tables=""; int id=ylhq1_dtps_d1Form.getid(); Vector show1=new Vector(); Vector show2=new Vector(); if(table.equalsIgnoreCase("YLHQ1_DT")) { table1="YLHQ1_DT_TP"; } else if(table.equalsIgnoreCase("YLHQ1_PS")) { table1="YLHQ1_PS_TP"; } sql="select title,contents from "+table+" where id='"+id+"'"; rs=db.executeQuery(sql); while(rs.next()) { Sctj sctj=new Sctj(); sctj.settitles(rs.getString("title")); contents=rs.getString("contents"); sctj.setcontents(contents); show1.add(sctj); } rs.close(); sql="select content from " +table1+ " where id='"+id+"'"; rs=db.executeQuery(sql); while(rs.next()) { Sctj sctj=new Sctj(); sctj.setcontents(rs.getString("content")); show2.add(sctj); } rs.close(); if(table.equalsIgnoreCase("YLHQ1_DT")) { tables="原料动态"; } if(table.equalsIgnoreCase("YLHQ1_PS")) { tables="行情评述"; } request.setAttribute("table",table); request.setAttribute("id",String.valueOf(id)); request.setAttribute("tables",tables); request.setAttribute("show2",show2); request.setAttribute("show1",show1); return mapping.findForward("Success"); //throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -