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

📄 tf_005finfo_005fupdate_jsp.java

📁 这是我上次报java培训时
💻 JAVA
字号:
package org.apache.jsp.web_005fpage.info_005fall.info;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import jinLing.pub.*;
import jinLing.info.*;

public final class tf_005finfo_005fupdate_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"../../pub_include/ErrPage.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write(" \r\n");
      out.write(" ");
request.setCharacterEncoding("gb2312");
      out.write(" \r\n");
      out.write(" ");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../../pub_include/pub_function_javascript.html", out, true);
      out.write("  \r\n");
      out.write(" \r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<style>\r\n");
      out.write("<!--\r\n");
      out.write(".style2 {color: #FFFFFF}\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../pub_include/hosc.css\">\r\n");
      out.write("<link href=\"../../pub_include/body_css.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"> \r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("body {\r\n");
      out.write("\tbackground-color: #ffebbd;\r\n");
      out.write("}\r\n");
      out.write("-->\r\n");
      out.write("</style></head> \r\n");
 
  String INFO_TYPE = request.getParameter("INFO_TYPE").toString();
  Collection col = null;
  Hashtable list = new Hashtable(); 
  list.put("INFO_TYPE",INFO_TYPE);
 // PubOp pubOp = new PubOp("INFO");
 Info info=new Info(); 
//判断增加修改
  String optype = "1";
  if(null != request.getParameter("optype") && !request.getParameter("optype").toString().equals(""))
    optype=request.getParameter("optype").toString(); 

      out.write(" \r\n");
      out.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' background='../../images/bg.gif'   >\r\n");
      out.write("  <div align='center'>\r\n");
      out.write("  <center>\r\n");
      out.write("  <table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width=98% >\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td width='100%' height='10' align='center'></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td width='100%' height='0' valign='top' align='center'>\r\n");
      out.write("        <table width='100%' border='1' style='border-collapse: collapse; padding-left:5' bordercolor='#6595D6' cellpadding='0' cellspacing='0'> \r\n");

  String pPageNo = "1"; 
  if (null != request.getParameter("PAGENO") &&!request.getParameter("PAGENO").toString().trim().equals("")) 
     if (Integer.parseInt(request.getParameter("PAGENO"))<1) 
       pPageNo="1"; 
  else 
     pPageNo=request.getParameter("PAGENO"); 
  col = info.execSel(list,pPageNo,"5");
  String pPageCount = String.valueOf(info.getRecordcount());
  String allCount = pPageCount; 
  pPageCount = (Integer.parseInt(pPageCount)%5==0)?String.valueOf(Integer.parseInt(pPageCount)/5):String.valueOf(Integer.parseInt(pPageCount)/5+1);
  if (Integer.parseInt(pPageCount)<Integer.parseInt(pPageNo))
    pPageNo=pPageCount;
  Iterator it = col.iterator();
  while (it.hasNext())
   {
     Hashtable rs = (Hashtable) it.next();

      out.write("\r\n");
      out.write("          <tr class='table_list_lr'> \r\n");
      out.write("            <td     align=\"left\"  > ");
      out.print(rs.get("INFO_CONTENT"));
      out.write("             </td>\r\n");
      out.write("    <!--删除和修改还要传一些条件参数-->\r\n");
      out.write("            <td align='center' height='20'  width='5%'  valign='middle'>              <img src='../../images/del.gif' width='18' height='18' border='0' style='cursor:hand' onClick=\"Del_ID('");
      out.print(rs.get("INFO_ID"));
      out.write("')\">\r\n");
      out.write("            </td>\r\n");
      out.write("            <td  align='center' height='20'  width='5%' valign='middle'>\r\n");
      out.write("              <a href='tf_info_update.jsp?optype=2&INFO_TYPE=");
      out.print(INFO_TYPE);
      out.write("&INFO_ID=");
      out.print(rs.get("INFO_ID"));
      out.write("'>                <img src='../../images/edit.gif' width='18' height='18' border='0' style='cursor:hand'>\r\n");
      out.write("              </a>\r\n");
      out.write("            </td>\r\n");
      out.write("         </tr>\r\n");
      out.write(" ");
 
   } 

      out.write(" \r\n");
      out.write("     </table> \r\n");
      out.write("    </td> \r\n");
      out.write("    </tr> \r\n");
      out.write("  </table> \r\n");
      out.write("  <table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width=90% > \r\n");
      out.write("    ");
 
      String strpageno = "tf_info_update.jsp"; 
    
      out.write(" \r\n");
      out.write("    <form action='");
      out.print(strpageno);
      out.write("' method='POST' name='form_list'> \r\n");
      out.write("    <tr> \r\n");
      out.write("      <td height='17' valign='top' align='center'>&nbsp; </td> \r\n");
      out.write("      <td  height='17' valign='top' align='center'> <br>\r\n");
 
  String vFirstURL = strpageno; 
  String vPrevURL =  strpageno+"?INFO_TYPE="+INFO_TYPE+"&PAGENO="+(Integer.parseInt(pPageNo)-1); 
  String vNextURL =  strpageno+"?INFO_TYPE="+INFO_TYPE+"&PAGENO="+((Integer.parseInt(pPageCount)<(Integer.parseInt(pPageNo)+1))?(Integer.parseInt(pPageCount)):(Integer.parseInt(pPageNo)+1)); 
  String vLastURL =  strpageno+"?INFO_TYPE="+INFO_TYPE+"&PAGENO="+pPageCount; 

      out.write(" \r\n");
      out.write("        <A onClick=\"PrevURLFun();\"  style=\"cursor:hand \"> 上一页 </A>   \r\n");
      out.write("\t\t<A onClick=\"NextURLFun();\" style=\"cursor:hand \"> 下一页 </A>  \r\n");
      out.write("<script language=javascript>\r\n");
      out.write("   function PrevURLFun()\r\n");
      out.write("   {\r\n");
      out.write("      self.location = \"");
      out.print(vPrevURL);
      out.write("\";\r\n");
      out.write("\t  return true;\r\n");
      out.write("   }\r\n");
      out.write("   function NextURLFun()\r\n");
      out.write("   {\r\n");
      out.write("      self.location = \"");
      out.print(vNextURL);
      out.write("\";\r\n");
      out.write("\t  return true;\r\n");
      out.write("   }\r\n");
      out.write("\r\n");
      out.write("</script>                    \r\n");
      out.write("      </td> \r\n");
      out.write("    </tr> \r\n");
      out.write("    </form> \r\n");
      out.write("  </table> \r\n");
      out.write("</center> \r\n");
      out.write("</div> \r\n");
      out.write("<script language=\"javascript\"> \r\n");
      out.write("  function onCommit()    //回车键后触发 \r\n");
      out.write("  { \r\n");
      out.write("    var p = document.form_list.PAGENO.value; \r\n");
      out.write("     //输入页数若大于总页数,则跳到最后一页 \r\n");
      out.write("    if(parseInt(p)>");
      out.print(Integer.parseInt(pPageCount));
      out.write(") \r\n");
      out.write("      document.form_list.PAGENO.value = ");
      out.print(Integer.parseInt(pPageCount));
      out.write(" \r\n");
      out.write("    if (window.event.keyCode==13) \r\n");
      out.write("    { \r\n");
      out.write("      document.form_list.submit(); \r\n");
      out.write("    } \r\n");
      out.write(" } \r\n");
      out.write("    //接收上面传来的唯一A_ID值付给pval \r\n");
      out.write("  function Del_ID(pval) \r\n");
      out.write("  { \r\n");
      out.write("    if (window.confirm(\"您确认删除吗?\")) \r\n");
      out.write("      { \r\n");
      out.write("        self.location = \"tf_info_del.jsp?INFO_ID=\"+pval+\"&INFO_TYPE=");
      out.print(INFO_TYPE);
      out.write("\"; \r\n");
      out.write("        return true; \r\n");
      out.write("       } \r\n");
      out.write("                   return false; \r\n");
      out.write("  } \r\n");
      out.write("</script> \r\n");
      out.write("    </td> \r\n");
      out.write("  </tr> \r\n");
      out.write("</table> \r\n");
      out.write("</center> \r\n");
      out.write("</div> \r\n");
      out.write("</center> \r\n");
      out.write("</div> \r\n");
 
String INFO_ID= "" ;   //INFO_ID 
String INFO_CONTENT= "" ;   //INFO_CONTENT 
String INFO_REMARK= "" ; 
int type=Integer.parseInt(optype);
if(type==2)
{
  if(null != request.getParameter("INFO_ID") && !request.getParameter("INFO_ID").toString().equals(""))
  {
    INFO_ID = request.getParameter("INFO_ID").toString();
    list.put("INFO_ID",INFO_ID);
    col = info.execSel(list);
    Iterator ir = col.iterator();
    Hashtable tt = new Hashtable();
    if (ir.hasNext())
    {
      tt=(Hashtable)ir.next();
      INFO_TYPE = Util.getNulltoStr(tt.get("INFO_TYPE"));   //  INFO_TYPE
      INFO_CONTENT = Util.getNulltoStr(tt.get("INFO_CONTENT"));   //  INFO_CONTENT
	  INFO_REMARK= Util.getNulltoStr(tt.get("INFO_REMARK")); 
    }
  }
}

      out.write("\r\n");
      out.write("<form action=\"tf_info_java.jsp\" name=\"form_query\" method=\"post\" onSubmit=\"return ActionStatus()\" >\r\n");
      out.write("  <input name=\"optype\"  type=\"hidden\"  value=\"");
      out.print(optype);
      out.write("\" >\r\n");
      out.write("  <input name=\"INFO_ID\" type=\"hidden\" value=\"");
      out.print(INFO_ID);
      out.write("\">\r\n");
      out.write("  <input type='hidden' onKeyDown = 'nextInput()' name='INFO_TYPE' size='25'   value='");
      out.print(INFO_TYPE);
      out.write("' >\r\n");
      out.write("  <div align=\"center\">\r\n");
      out.write("  <center>\r\n");
      out.write("    <table width='95%' border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111'>\r\n");
      out.write("     <tr>\r\n");
      out.write("          <td class='table_list'>标题:\r\n");
      out.write("            <input type='TEXT' onkeydown = 'nextInput()' name='INFO_CONTENT' size='69'    value='");
      out.print(INFO_CONTENT);
      out.write("' >&nbsp;            </td>\r\n");
      out.write("     <tr>\r\n");
      out.write("       <td class='table_list'>内容:\r\n");
      out.write("<textarea    cols='68' rows=\"8\" name='INFO_REMARK'  >");
      out.print(INFO_REMARK);
      out.write("</textarea></td>\r\n");
      out.write("     <tr>\r\n");
      out.write("       <td class='table_list'><input type=\"submit\"  value=\"提交\"  border=\"0\"  >\r\n");
      out.write("         <input  type=\"reset\"  value=\"取消\"></td>\r\n");
      out.write("     </table> \r\n");
      out.write("</center> \r\n");
      out.write("</div> \r\n");
      out.write("<br> \r\n");
      out.write("</form> \r\n");
      out.write("<script language=javascript>\r\n");
      out.write("function ActionStatus()\r\n");
      out.write("{\r\n");
      out.write("  return check_input();\r\n");
      out.write(" }\r\n");
      out.write("function  check_input(){\r\n");
      out.write(" var type=true;\r\n");
      out.write(" type=check_null(document.form_query.INFO_CONTENT,'请输入标题!!')\r\n");
      out.write(" if (!type)\r\n");
      out.write(" {\r\n");
      out.write("   return false;\r\n");
      out.write("  }\r\n");
      out.write("  return true;\r\n");
      out.write("  }\r\n");
      out.write(" </script>\r\n");
      out.write(" \r\n");
      out.write(" </body>\r\n");
      out.write(" </html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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