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

📄 upimg_0005fsoft_0002ejsp_jsp.java

📁 一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.
💻 JAVA
字号:
package admin;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import javax.servlet.http.HttpServletRequest;
import com.bwm.model.Head;
import com.bwm.core.*;
import com.jspsmart.upload.*;

public class upimg_0005fsoft_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=GBK");
      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;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
if (!Crazyadept.UserIsOK(session,FinalConstants.STATUS_ADMIN)) return;
      out.write("\r\n");
      com.jspsmart.upload.SmartUpload up = null;
      synchronized (pageContext) {
        up = (com.jspsmart.upload.SmartUpload) pageContext.getAttribute("up", PageContext.PAGE_SCOPE);
        if (up == null){
          try {
            up = (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("up", up, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<body>\r\n");
      out.write("<table width=\"100%\" height=\"80%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n  ");
      out.write("<tr>\r\n    ");
      out.write("<td height=\"27\">");
        session.removeAttribute("error");
        int count=0;        up.initialize(pageContext);        up.setTotalMaxFileSize(1000000);
    up.setAllowedFilesList("gif,jpg");        try{up.upload();}catch(Exception e){}
        BasetableFactory bf=BasetableFactory.getInstance();
    java.util.Random r=new java.util.Random(System.currentTimeMillis()+1);
        long longr=r.nextLong();
        long longd=System.currentTimeMillis()+longr;
        String name=new Long(longr).toString();
        name=name.replace('-','_');
        File f=up.getFiles().getFile(0);
        String path="images/soft/"+name+"."+f.getFileExt();
        if(!f.isMissing()){
            try {  f.saveAs(path); } catch (Exception e) {}
                    if(bf.CreateHead(name,path,FinalConstants.STATE_SOFT)){
                        out.println("涓婁紶鎴愬姛");
                    }else{
                        session.setAttribute("error","涓婁紶澶辫触");
                        response.sendRedirect("errorw.jsp");}
                }
      out.write("</td>\r\n  ");
      out.write("</tr>\r\n  ");
      out.write("<tr>\r\n    ");
      out.write("<td align=\"center\" valign=\"bottom\">");
      out.write("<a style=\"cursor:hand\" onClick=\"javascrip:opener.document.forms.ico.src='../");
      out.print(path);
      out.write("';opener.document.forms.iid.value='");
      out.print(name);
      out.write("';window.close();\">");
      out.write("<img src=\"../images/close.gif\" border=\"0\">");
      out.write("</a>");
      out.write("</td>\r\n  ");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } 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 + -