File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes jsp file not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp file not found error" Watch "jsp file not found error" New topic
Author

jsp file not found error

Abhijit Bhalkikar
Greenhorn

Joined: Mar 21, 2001
Posts: 3
i have 1 "main.jsp" file(code given below), 1 "main.xml" file which is parsed by the jsp file with the help of 1 "saxhandler.class" java file. whenever i invoke the jsp file on the Tomcat server, i am getting HTTP 404 (jsp file not found error). This error started appearing only after i had eliminated all the syntactical/other errors that occured during jsp file compilation.
can anybody pls. tell the solution?

<html>
<body>
<%@ page language="java" %>
<%@ page import="javax.xml.parsers.SAXParserFactory" %>
<%@ page import="javax.xml.parsers.SAXParser" %>
<%@ page import="org.xml.sax.*" %>
<%@ page import="SAXHandler" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="org.w3c.dom.*" %>
<%
File file=new File("/purejsp/main.xml");
FileReader reader=new FileReader(file);
SAXParserFactory spf=SAXParserFactory.newInstance();
SAXParser sp=spf.newSAXParser();
SAXHandler handler=new SAXHandler();
sp.parse(new InputSource(reader), handler);
Hashtable cfgTable=handler.getTable();
%>
<table align="center" width="100%">
<tr>
<td width="30%" bgcolor="#FEFFEC">
<table align="center" width="80%">
<tr><td colspan=3 bgcolor="#FFFFCC"><font color="#4A4A4A" size="6"><u><%=(String)cfgTable.get(new String("link1"))%></u></font></td>
<tr><td colspan=3 bgcolor="#FFFFCC"><font color="#4A4A4A" size="6"><u><%=(String)cfgTable.get(new String("link2"))%></u></font></td>
<tr><td colspan=3 bgcolor="#FFFFCC"><font color="#4A4A4A" size="6"><u><%=(String)cfgTable.get(new String("link3"))%></u></font></td>
</table>
</td>
<td width="70%" bgcolor="#660033">
<table align="center" width="80%">
<tr><td width=480 bgcolor="#660033"> </td></tr>
<tr><td width=480 bgcolor="#FFFFCC"><font color="#660033" size=+4><u><%=(String)cfgTable.get(new String("title1"))%></u></font></td>
<tr><td width=480 bgcolor="#FFFFCC"><font color="#660033" size=+4><u><%=(String)cfgTable.get(new String("title2"))%></u></font></td>
<tr><td width=480 bgcolor="#FFFFCC"><font color="#660033" size=+4><u><%=(String)cfgTable.get(new String("title3"))%></u></font></td>
<tr><td width=480 bgcolor="#FFFFCC"> </td></tr>
<tr><td width=480 bgcolor="#FFFFCC"> </td></tr>
<tr><td width=480 bgcolor="#FFFFCC"> </td></tr>
</table>
</td>
</tr>
</table>

</body>
<html>
marko markovic
Greenhorn

Joined: Mar 16, 2001
Posts: 28
Hi,
How's about your configuration in the file server.xml?
if you use tomcat 3.2.1 you have a file server.xml in tomcat/conf.
You must put the following lines:
<Context path="/DirectoryOfYourJSP"
docBase="webapps/DirectoryOfYourJSP"
debug="0"
reloadable="true" >
</Context>
and then you must restart tomcat.
The address is then for example : http://127.0.0.1:8080/DirectoryOfYourJSP/welcome.jsp
If you have errors with your Js pages you must look if you have all classes in directory web-inf/classes of your DirectoryOfYourJSP.

Hope it will help!
$Regards
Abhijit Bhalkikar
Greenhorn

Joined: Mar 21, 2001
Posts: 3
hello marko,
i have already made a 'purejsp' directory under the server root & the server.xml file is configured as follows:
<Context path="/purejsp" docBase="purejsp" defaultSessionTimeOut="30" isWARExpanded="true"
isWARValidated="false" isInvokerEnabled="true isWorkDirPersistent="false">
</Context>
Also my servlet class file has been stored in the purejsp/web-inf/classes directory.
After doing this only, i am getting the error. another interesting thing had happened. A jsp.bak file had been created.
After clicking on this file , I got a partial output of the page.
But when I deleted this file & clicked on the main jsp file, i started getting the same error. I wonder if this is a internal server problem.
Regards,
Abhijit.
marko markovic
Greenhorn

Joined: Mar 16, 2001
Posts: 28
Hi,
can you see any other jsPage? Create one temp.jsp only with html code and try if you see it.
When not, i think you must put you purejsp directory in
ex. C:\Program Files\Apache Group\tomcat3.2.1\webapps,
because there tomcat search about sites
and you context is then
<Context path="/purejsp" docBase="webapps/purejsp" defaultSessionTimeOut="30" isWARExpanded="true"
isWARValidated="false" isInvokerEnabled="true isWorkDirPersistent="false">
</Context>
Try this and tell if it works!
$Regards
Abhijit Bhalkikar
Greenhorn

Joined: Mar 21, 2001
Posts: 3
hi,
web-apps is just another directory. So it doesnot matter if the application should be stored in this dir. or some other as long as the path is set right in the server.xml file.
I have tried putting "purejsp" in "web-apps" also but still its not working.
regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp file not found error
 
Similar Threads
JSP error 500
JSP Help Regarding the Radio Button
INCLUDES.DBconnection error
I M NOT ABLE TO DEFINE VARIABLES IN JSP.
tag nesting error