<%@ page import="java.io.InputStream" %> <%@ page import="java.io.FileInputStream" %> <%@ page import="java.io.File" %> <%@ page import="java.io.InputStreamReader" %> <%@ page import="java.net.URL" %> <% String newsList = request.getParameter("newsList"); File newsFile = new File(pageContext.getServletContext().getRealPath("/projects/"+newsList+"/news.html")); if (newsFile.exists()) { InputStream is = new FileInputStream(newsFile); InputStreamReader isr = null; StringBuffer buffer = null; isr = new InputStreamReader(is);//, "UTF8"); buffer = new StringBuffer(); int ch; while ( (ch = isr.read()) > -1) { buffer.append( (char) ch); } if (isr != null) { isr.close(); } out.write(buffer.toString()); } else { out.print("No News"); } %>