📄 ylhq1_dtps_daction.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.Fkind;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_dForm;/** * Ylhq1_dtps_dAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 10-20-2004 * * XDoclet definition: * @struts:action path="/ylhq1_dtps_d" name="ylhq1_dtps_dForm" input="/ylhq1_dtps_d.jsp" validate="true" */public class Ylhq1_dtps_dAction 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_dForm ylhq1_dtps_dForm = (Ylhq1_dtps_dForm) form; int i=0; int shownum=40; int allnum=0; int currentpage=1; int nextpage; int uppage; String page=ylhq1_dtps_dForm.getpage(); String table=ylhq1_dtps_dForm.getable(); String tables = null; dbconnect db=new dbconnect(); Vector vector=new Vector(); currentpage=(page==null)?(1):(Integer.parseInt(page)); String sql = "select count(id) from "+table+" "; ResultSet rs = db.executeQuery(sql) ; while(rs.next()) i = rs.getInt(1) ; allnum=i; sql=""; int intPageCount=(i%shownum==0)?(i/shownum):(i/shownum+1);//总页数 if(currentpage>intPageCount) currentpage=intPageCount; nextpage = currentpage+1; if (nextpage>=intPageCount) nextpage=intPageCount; uppage = currentpage-1; if (uppage<=1) uppage=1; Fkind find=new Fkind(); sql="select TITLE,ID,PUBDATE from "+table+" order by id desc"; vector=find.getTitleId(sql,shownum,currentpage); request.setAttribute("vector",vector); request.setAttribute("table",table); request.setAttribute("allnum",String.valueOf(allnum)); request.setAttribute("currentpage",String.valueOf(currentpage)); request.setAttribute("intPageCount",String.valueOf(intPageCount)); request.setAttribute("nextpage",String.valueOf(nextpage)); request.setAttribute("uppage",String.valueOf(uppage)); if(table.equalsIgnoreCase("YLHQ1_DT")) { tables="原料动态"; } else if(table.equalsIgnoreCase("YLHQ1_PS")) { tables="行情评述"; } request.setAttribute("tables",tables); return mapping.findForward("Success"); //throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -