【Java开源代码栏目提醒】:网学会员为需要Java开源代码的朋友们搜集整理了Write_005ftest1_jsp.java相关资料,希望对各位网友有所帮助!
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.*;
public final class Write_005ftest1_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List 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("<html>\r\n");
out.write("<head>\r\n");
out.write("<title>\r\n");
out.write("鍚戞枃浠朵腑鍐欏叆鍐呭\r\n");
out.write("</title>\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("\r\n");
test.WriteFile writer = null;
synchronized (session) {
writer = (test.WriteFile) _jspx_page_context.getAttribute("writer", PageContext.SESSION_SCOPE);
if (writer == null){
writer = new test.WriteFile();
_jspx_page_context.setAttribute("writer", writer, PageContext.SESSION_SCOPE);
}
}
out.write("\r\n");
out.write("<CENTER>\r\n");
out.write("<body>\r\n");
out.write("<FONT SIZE = 5 COLOR = blue>灏嗘暟鎹啓鍏ユ枃浠?/FONT>\r\n");
out.write("</CENTER>\r\n");
out.write("<BR>\r\n");
out.write("<HR>\r\n");
out.write("<BR>\r\n");
String path="C:\\a.txt";
String content="鏂囦欢鎿嶄綔瀵逛簬
JSP寰堥噸瑕?甯屾湜澶у鑳藉娣卞叆浜嗚Вjsp鎶鏈?绁濆ぇ瀹跺涔爅sp鎰夊揩!";
writer.setPath(path);
writer.setSomething(content);
out.println(writer.writeSomething());
out.write("\r\n");
out.write("<FONT SIZE = 4 COLOR = red>\r\n");
FileReader fr = new FileReader(path); //寤虹珛FileReader瀵硅薄,骞惰瀹氱敱fr瀵硅薄鍙橀噺寮曠敤
BufferedReader br = new BufferedReader(fr); //寤虹珛BufferedReader瀵硅薄,骞惰瀹氱敱br瀵硅薄鍙橀噺寮曠敤
String Line = br.readLine(); //璇诲彇涓琛屾暟鎹?
out.println(Line + "<BR>"); //杈撳嚭璇诲彇寰楃殑鏁版嵁
br.close(); //鍏抽棴BufferedReader瀵硅薄
fr.close(); //鍏抽棴鏂囦欢
out.write("\r\n");
out.write("</FONT>\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
} 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);
}
}
}