• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

jsp file not found error

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic