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

📄 index_jsp.java

📁 《struts应用开发完全手册》中的源代码及安装指导
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.*;
import com.actionForm.FileActionForm;

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

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(1);
    _jspx_dependants.add("/WEB-INF/struts-html.tld");
  }

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_html;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_form_onsubmit_enctype_action;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_text_property_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_file_property_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_submit;

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

  public void _jspInit() {
    _jspx_tagPool_html_html = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_html_form_onsubmit_enctype_action = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_html_text_property_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_html_file_property_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_html_submit = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _jspx_tagPool_html_html.release();
    _jspx_tagPool_html_form_onsubmit_enctype_action.release();
    _jspx_tagPool_html_text_property_nobody.release();
    _jspx_tagPool_html_file_property_nobody.release();
    _jspx_tagPool_html_submit.release();
  }

  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,
      			"", 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("\r\n");
      //  html:html
      org.apache.struts.taglib.html.HtmlTag _jspx_th_html_html_0 = (org.apache.struts.taglib.html.HtmlTag) _jspx_tagPool_html_html.get(org.apache.struts.taglib.html.HtmlTag.class);
      _jspx_th_html_html_0.setPageContext(_jspx_page_context);
      _jspx_th_html_html_0.setParent(null);
      int _jspx_eval_html_html_0 = _jspx_th_html_html_0.doStartTag();
      if (_jspx_eval_html_html_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        do {
          out.write("\r\n");
          out.write("  <head>\r\n");
          out.write("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
          out.write("    <link href=\"css/style.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
          out.write("    <title>利用Struts框架实现文件的上传和下载</title>\r\n");
          out.write("  </head>\r\n");
          out.write("<script language=\"javascript\" type=\"\">\r\n");
          out.write("function Mycheck(){\r\n");
          out.write("if (fileActionForm.fileName.value==\"\")\r\n");
          out.write("{ alert(\"请输入上传文件的名称!\");fileActionForm.fileName.focus();return  false;}\r\n");
          out.write("if (fileActionForm.file.value==\"\")\r\n");
          out.write("{ alert(\"请选择上传文件的路径!\");fileActionForm.file.focus();return false;}\r\n");
          out.write("form.submit();\r\n");
          out.write("}\r\n");
          out.write("</script>\r\n");

com.dao.FileDao dao=new com.dao.FileDao();
java.util.List list=dao.selectFile();
int number=list.size();//计算有多少条纪录
int row=number/3;
if(number/3!=0){
row=row+1;
}

          out.write("\r\n");
          out.write("  <body>\r\n");
          out.write("    <table width=\"719\" height=\"118\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
          out.write("      <tr>\r\n");
          out.write("        <td background=\"priture/top.jpg\">&nbsp;</td>\r\n");
          out.write("      </tr>\r\n");
          out.write("    </table>\r\n");
          out.write("    <table width=\"719\" height=\"418\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" background=\"priture/certer.jpg\">\r\n");
          out.write("      <tr>\r\n");
          out.write("        <td width=\"125\" >&nbsp;</td>\r\n");
          out.write("        <td width=\"594\" valign=\"top\">\r\n");
          out.write("\r\n");
          out.write("\t\t<br>\r\n");
          out.write("\r\n");
          out.write("\t\t<table height=\"117\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
          out.write("          ");
for(int i=0;i<list.size();i++){
   FileActionForm  form=(FileActionForm)list.get(i);
if(i%2==0){
 
          out.write("\r\n");
          out.write("          <tr>\r\n");
          out.write("            <td height=\"113\">\r\n");
          out.write("              <table width=\"264\" height=\"81\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
          out.write("                <tr>\r\n");
          out.write("                  <td width=\"115\"  rowspan=\"4\" align=\"center\"><img src=\"");
          out.print(form.getFilePath());
          out.write("\" width=\"100\" height=\"100\"></td>\r\n");
          out.write("                  <td width=\"133\" align=\"center\">图片名称:");
          out.print(form.getFileName());
          out.write("</td>\r\n");
          out.write("                </tr>\r\n");
          out.write("                <tr align=\"center\">\r\n");
          out.write("                  <td>图片大小:");
          out.print(form.getFileSize());
          out.write("</td>\r\n");
          out.write("                </tr>\r\n");
          out.write("                <tr align=\"center\">\r\n");
          out.write("                  <td>上传日期:");
          out.print(form.getFileDate());
          out.write("</td>\r\n");
          out.write("                </tr>\r\n");
          out.write("                <tr>\r\n");
          out.write("                  <td align=\"center\"><a href=\"fileAction.do?method=downFile&path=");
          out.print(form.getFilePath());
          out.write("\" ><img src=\"priture/bottond.jpg\"></a></td>\r\n");
          out.write("                </tr>\r\n");
          out.write("            </table></td>\r\n");
          out.write("            ");
}else{
          out.write("\r\n");
          out.write("            <td>\r\n");
          out.write("              <table width=\"264\" height=\"81\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
          out.write("                <tr>\r\n");
          out.write("                  <td width=\"115\"  rowspan=\"4\" align=\"center\"><img src=\"");
          out.print(form.getFilePath());
          out.write("\" width=\"100\" height=\"100\"></td>\r\n");
          out.write("                  <td width=\"133\" align=\"center\">图片名称:");
          out.print(form.getFileName());
          out.write("</td>\r\n");
          out.write("                </tr>\r\n");
          out.write("                <tr align=\"center\">\r\n");
          out.write("                  <td>图片大小:");
          out.print(form.getFileSize());
          out.write("</td>\r\n");
          out.write("                </tr>\r\n");

⌨️ 快捷键说明

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