• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Page Not Found Error w/ JSP

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm teaching myself JSP, and in trying to run a jsp from a book I'm reading I consistently get a "Page cannot be found" error in MIE.
I'm running Tomcat 3.2.2 on an Apache server, on a Linux box. I know the file is where I think I said it is. Here's my code:
<html>
<head>
<title>Read a File</title>
</head>
<body>
<%@ page import="java.io.*" %>
<pre>
<%
File fileObject = new File("c:\\java\\test.txt");
FileReader fileRead = new FileReader( fileObject );
BufferedReader buffFileIn = new BufferedReader( fileRead );
String line = "";
while( ( line = buffFileIn.readline() ) != null )out.println( line + "<br>" );
fileRead.close();
%>
</pre>
</body>
</html>
I'm guessing I've made some sort of syntax error. I'm trying to get a file from my computer (a Windows machine, not the same machine as the Linux machine on which Tomcat and Apache are running). Does anyone know what I'm doing wrong? My other jsp's work just fine.
Thanks in advance for any enlightenment.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the tomcat logs. A 404-style page-not-found message would mean that you misspelled or miscapitalized the jsp's name. A 500-style message would mean that the jsp could not compile or abnormally terminated.
 
Adam Vinueza
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting a 404 message. The problem is, I'm selecting the JSP from a directory that lists the file. Also, when I introduce a deliberate error into the JSP (I commented out the line defining fileObject), I get an ordinary error message. So the file is being looked at somehow. I just don't know what's going on here.
 
reply
    Bookmark Topic Watch Topic
  • New Topic