_file2__jsp.java

来自「公司企业网站管理系统中文豪华版」· Java 代码 · 共 224 行

JAVA
224
字号
/*
 * JSP generated by Resin-3.0.19 (built Mon, 15 May 2006 04:50:47 PDT)
 */

package _jsp._basic._admin;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.io.*;
import mfkvit.JdbcBean;
import java.util.*;

public class _file2__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;
  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    javax.servlet.http.HttpSession session = request.getSession(true);
    com.caucho.server.webapp.Application _jsp_application = _caucho_getApplication();
    javax.servlet.ServletContext application = _jsp_application;
    com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false);
    javax.servlet.jsp.JspWriter out = pageContext.getOut();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    response.setContentType("text/html;charset=gb2312");
    request.setCharacterEncoding("GB2312");
    try {
      out.write(_jsp_string0, 0, _jsp_string0.length);
      mfkvit.login login;
      synchronized (session) {
        login = (mfkvit.login) session.getAttribute("login");
        if (login == null) {
          login = new mfkvit.login();
          session.setAttribute("login", login);
          out.write(_jsp_string1, 0, _jsp_string1.length);
        }
      }
      out.write(_jsp_string1, 0, _jsp_string1.length);
      
if(session.isNew()){response.sendRedirect("index.jsp");}
String success=login.getSuccess();
if(success==null){success="";}
if(!(success.equals("ok"))){response.sendRedirect("index.jsp");}

      out.write(_jsp_string2, 0, _jsp_string2.length);
          String tempfilename=(String)session.getId();
         
		 String path2=getServletContext().getRealPath("")+"/basic/ShangChuangImg"; 
		 System.out.print(path2);
  
          File f1=new File(path2,tempfilename);
          int n;
          try
          {
              InputStream in=request.getInputStream();
              BufferedInputStream my_in=new BufferedInputStream(in);
              FileOutputStream fout=new FileOutputStream(f1);
              BufferedOutputStream my_out=new BufferedOutputStream(fout);
              byte[] b=new byte[10000];
              while((n=my_in.read(b))!=-1)
              {
                   my_out.write(b,0,n);
              }
              my_out.flush();
              my_out.close();
              fout.close();
              my_in.close();
              in.close();
             // out.print("\u56fe\u7247\u4e0a\u4f20\u6210\u529f!<br>");
          }
          catch(IOException e)
          {
              out.print("\u6587\u4ef6\u4e0a\u4f20\u5931\u8d25!");
          }
          
          try
          {   
              RandomAccessFile random1=new RandomAccessFile(f1,"r");
              random1.readLine();
              String filename=random1.readLine();
              byte[] b=filename.getBytes("ISO-8859-1");
              filename=new String(b);
              int pointer=filename.lastIndexOf('\\');
              filename=filename.substring(pointer+1,filename.length()-1);
              File f2=new File(path2,filename);
			  session.setAttribute("name",filename);
              RandomAccessFile random2=new RandomAccessFile(f2,"rw");
              random1.seek(0);
              for(int i=1; i<=4; i++)
              {
                   String tempstr=random1.readLine();
              }
              long startPoint=random1.getFilePointer();
              random1.seek(random1.length());
              long mark=random1.getFilePointer();
              int j=0;
              long endPoint=0;
              while((mark>=0)&&(j<=5))
              {
                   mark--;
                   random1.seek(mark);
                   n=random1.readByte();
                   if(n=='\n')
                   {
                         j++;
                         endPoint=random1.getFilePointer();
                   }
              }
              long length=endPoint-startPoint+1;
              int order=(int)(length/10000);
              int left=(int)(length%10000);
              byte[] c=new byte[10000];
              random1.seek(startPoint);
              for(int i=0; i<order; i++)
              {
                    random1.read(c);
                    random2.write(c);
              }
              random1.read(c,0,left);
              random2.write(c,0,left);
              random1.close();
              random2.close();
              f1.delete();
             //out.print("\u6587\u4ef6\u66f4\u65b0\u6210\u529f!");
			 // out.print(filename);
     request.setCharacterEncoding("gb2312");
    try{
      JdbcBean jdbc = new JdbcBean();
            String condition = "update webDes set loginimg='" + "/basic/ShangChuangImg/"+filename + "'";                 
            System.out.print(condition);
            jdbc.execUpdate(condition);
            out.println("<script languaga=\"JavaScript\">alert(\"   \u4e0a\u4f20\u6210\u529f\uff01\");window.location = \"wzpz.jsp\";</script>");
         
        } catch (Exception ex) {
            ex.printStackTrace();
            out.print("<script>alert('    \u4e0a\u4f20\u5931\u8d25')</script>");
            out.print("<script>history.back(-1)</script>"); //\u8fd4\u56de\u539f\u6765\u9875\u9762
        }
		out.println("<script languaga=\"JavaScript\">window.location = \"wzpz.jsp\";</script>");
          }
          catch(Exception e)
          {
          out.print("<script>alert('    \u4e0a\u4f20\u5931\u8d25')</script>");
            out.print("<script>history.back(-1)</script>"); //\u8fd4\u56de\u539f\u6765\u9875\u9762
			 
          }
      out.write(_jsp_string3, 0, _jsp_string3.length);
    } catch (java.lang.Throwable _jsp_e) {
      pageContext.handlePageException(_jsp_e);
    } finally {
      com.caucho.jsp.QJspFactory.freePageContext(pageContext);
    }
  }

  private java.util.ArrayList _caucho_depends = new java.util.ArrayList();

  public java.util.ArrayList _caucho_getDependList()
  {
    return _caucho_depends;
  }

  public void _caucho_addDepend(com.caucho.make.PersistentDependency depend)
  {
    super._caucho_addDepend(depend);
    com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
  }

  public boolean _caucho_isModified()
  {
    if (_caucho_isDead)
      return true;
    if (com.caucho.util.CauchoSystem.getVersionId() != 7932908523769947432L)
      return true;
    for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
      com.caucho.make.Dependency depend;
      depend = (com.caucho.make.Dependency) _caucho_depends.get(i);
      if (depend.isModified())
        return true;
    }
    return false;
  }

  public long _caucho_lastModified()
  {
    return 0;
  }

  public void destroy()
  {
      _caucho_isDead = true;
      super.destroy();
  }

  public void init(com.caucho.vfs.Path appDir)
    throws javax.servlet.ServletException
  {
    com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
    com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
    mergePath.addMergePath(appDir);
    mergePath.addMergePath(resinHome);
    com.caucho.loader.DynamicClassLoader loader;
    loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
    String resourcePath = loader.getResourcePathSpecificFirst();
    mergePath.addClassPath(resourcePath);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(appDir.lookup("basic/admin/file2.jsp"), 3393960590295341470L, false);
    com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
  }

  private final static char []_jsp_string3;
  private final static char []_jsp_string0;
  private final static char []_jsp_string2;
  private final static char []_jsp_string1;
  static {
    _jsp_string3 = "\r\n\r\n   </p>\r\n\r\n</body>\r\n</html>\r\n              \r\n              ".toCharArray();
    _jsp_string0 = "\r\n\r\n\r\n".toCharArray();
    _jsp_string2 = "\r\n<html>\r\n<link href=\"c.css\" rel=\"stylesheet\" type=\"text/css\">\r\n<style type=\"text/css\">\r\n<!--\r\nbody {\r\n	margin-left: 0px;\r\n	margin-top: 50px;\r\n	background-image: url();\r\n	margin-bottom: 0px;\r\n	background-color: #d6dff7;\r\n}\r\n-->\r\n</style><body>\r\n   <p>\r\n     ".toCharArray();
    _jsp_string1 = "\r\n".toCharArray();
  }
}

⌨️ 快捷键说明

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