c10_005f6_jsp.java

来自「Internet 开发技术分章节代码和自己完成的课程设计全代码(在zuoye文件」· Java 代码 · 共 86 行

JAVA
86
字号
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.*;

public final class c10_005f6_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.List _jspx_dependants;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=GB2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      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("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>字符文件的复制</title>\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("     <h3>字符文件读写</h3><HR>\r\n");

    File filePath=new File("F:/xiti/ch10/WebContent"); 
    File sourceFile=new File(filePath,"data1.txt");  //在指定目录下建文件类对象
    File targetFile=new File(filePath,"data2.txt");  //在指定目录下建文件类对象
    String temp;       
    try
      {
         BufferedReader source= new BufferedReader(new FileReader(sourceFile)); 
         BufferedWriter target= new BufferedWriter(new FileWriter(targetFile));
         while((temp=source.readLine( )) != null)
            {  target.write(temp);
               target.newLine( );
               target.flush( );
            }
            out.println("<BR>"+"复制文件完成!!!");
        source.close( );
		target.close( );
	   }
      catch(IOException E){out.println("<BR>"+"I/O错误!");  }	       

      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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