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

📄 download_0002ejsp_jsp.java

📁 一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.
💻 JAVA
字号:
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import com.jspsmart.upload.*;
import com.bwm.core.*;
import com.bwm.model.*;

public class download_0002ejsp_jsp extends HttpJspBase {


  private static java.util.Vector _jspx_includes;

  public java.util.List getIncludes() {
    return _jspx_includes;
  }

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

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      com.jspsmart.upload.SmartUpload mySmartUpload = null;
      synchronized (pageContext) {
        mySmartUpload = (com.jspsmart.upload.SmartUpload) pageContext.getAttribute("mySmartUpload", PageContext.PAGE_SCOPE);
        if (mySmartUpload == null){
          try {
            mySmartUpload = (com.jspsmart.upload.SmartUpload) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.jspsmart.upload.SmartUpload");
          } catch (ClassNotFoundException exc) {
            throw new InstantiationException(exc.getMessage());
          } catch (Exception exc) {
            throw new ServletException("Cannot create bean of class " + "com.jspsmart.upload.SmartUpload", exc);
          }
          pageContext.setAttribute("mySmartUpload", mySmartUpload, PageContext.PAGE_SCOPE);
        }
      }

        int mid=ParamUtils.getIntParameter(request,"mid");
        int sfid=ParamUtils.getIntParameter(request,"sfid");
        BasetableFactory bf=BasetableFactory.getInstance();
        String name,path;
        if(sfid<=0&&mid>0){
                Mend m=bf.SearchMend("WHERE mid="+mid);
                name=m.getName();path="upload"+m.getPath();
                m.setLoadnum(m.getLoadnum()+1);}else{Soft s=bf.SearchSoft("WHERE sfid="+sfid);
                name=s.getName();path="upload"+s.getPath();s.setLoadnum(s.getLoadnum()+1);
        }
        java.io.File f=new java.io.File(application.getRealPath(path));
    if(!f.exists()){        session.setAttribute("error","\u6587\u4EF6\u4E0D\u5B58\u5728");
        response.sendRedirect("error.jsp");    }else{
                mySmartUpload.initialize(pageContext);
                System.out.println(path+"]path "+name);
                mySmartUpload.downloadFile(path,"application/x-zip-compressed");}
    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0)
        out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}

⌨️ 快捷键说明

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