view_source.jsp

来自「解压在c盘」· JSP 代码 · 共 30 行

JSP
30
字号
<%@ page import='com.caucho.vfs.*, java.io.*' %><% /* * view_source.jsp just writes the verbatim source to the browser. */// Chroot to the current directory so no one can use this as a p// security holdPath chroot = Pwd.lookupNative(request.getRealPath(".")).createRoot();Path path = chroot.lookupNative(request.getQueryString());if (path.isDirectory()) {  throw new IOException("file " + request.getQueryString() + " is a directory");}ReadStream is = path.openRead();int ch;out.println("<body bgcolor=white>");out.println("<pre>");while ((ch = is.read()) >= 0) {  if (ch == '<')    out.print("&lt;");  else    out.print((char) ch);}is.close();out.println("</pre>");out.println("</body>");%>

⌨️ 快捷键说明

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