title: Getting Scripting Error with JSP, Just trying to display txt file contents to browser window
body: <p>I am working on a homework assignment for a course. I have most of the project set up to get information from the user and such, but I want to display a simple text file to the browser as the last piece. No matter what I try, I cannot get it to work.</p>
  
  <p>I have to use either JSP or HTML, NOTHING ELSE. I would've much rather used another language or frankly anything that isn't as utterly infuriating as Java or its related pieces, but for educational purposes I cannot in this assignment. </p>
  
  <p>My code for the JSP page that displays the results is this:</p>
  
  <pre><code>&lt;%@page import="java.io.*"%&gt;
  
  &lt;%
      BufferedReader input = new BufferedReader(new FileReader("WEB-INF/EmailList.txt"));
      String line = "";
      while ((line = input.readLine()) != null) {
      out.println(line);
      }
      out.flush();
      input.close();
  
  %&gt;
  </code></pre>
  
  <p>I continue to get this error:</p>
  
  <pre><code>Scripting elements ( &amp;lt;%!, &amp;lt;jsp:declaration, 
  &amp;lt;%=, &amp;lt;jsp:expression, &amp;lt;%, &amp;lt;jsp:scriptlet ) 
  are disallowed here.
  </code></pre>
  
  <p>After countless hours of Googling and looking through other posts, I cannot seem to find an answer that makes any sense to me about this. All I want to do is display a simple text file to the screen. Pretty much every example I see is from 5 years or more ago when certain things must've been allowed. I am currently running latest version of Netbeans and the Tomcat Server 8 on Mac OSX 10.11.5.</p>
  
  <p>Can anyone maybe provide an answer that makes more sense than everything else I have read? I apologize for the frustration, this is one of the worst set up classes I have taken so far, and I typically cannot even get code to run so the fact that I am this far is impressive in itself. The teacher is also no help at all, and the book is on an entirely different tangent than the assignments posted biweekly.</p>