📄 upimg_0005fhead_0002ejsp_jsp.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_0005fhead_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 ");
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");
if (!Crazyadept.UserIsOK(session,FinalConstants.STATUS_ADMIN)) return;
session.removeAttribute("error");
out.write(" \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\">");
int count=0;
up.initialize(pageContext);
up.setTotalMaxFileSize(100000);
up.setAllowedFilesList("gif,jpg");
try{up.upload();}catch(Exception e){}
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/ico/"+name+"."+f.getFileExt();
BasetableFactory bf=BasetableFactory.getInstance();
if(!f.isMissing()){
try { f.saveAs(path);} catch (Exception e) {}
if(bf.CreateHead(name,path,FinalConstants.STATE_HEAD)){
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=\"javascript:history.back();\">杩斿洖涓婇〉");
out.write("</a> ");
out.write("<a style=\"cursor:hand\" onClick=\"javascrip:opener.location.reload();window.close();\">鍏抽棴绐楀彛");
out.write("</a>");
out.write("</td>\r\n ");
out.write("</tr>\r\n");
out.write("</table>\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 + -