Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem locating requested resource  RSS feed

 
Olakunle Oladipo Oni
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know the subject of this post is not new. I could as well as titled it HTTP status 404 issue. But since I am still learning and somethings are not totally clear to me I've decided to present the title as above so that more viewers
may not ignore my post/question because obviously there will be many posts titled "HTTT Status 404 error..." and various variants of it. So if you're reading this post I'll appreciate your patience and understanding even if you
feel prompted to dismiss my issue as a common matter that i should have resolved with past posts. Let us take this as peculiar to me...I'm trying to learn about servlets/jsp following the directive of an e-book (Head First Servlets and JSP) to the letter. I"ve installed tomcat (precisely apache-tomcat-6.0.53). The tomcat install directory was place directly under C:\.This e-book taught me to do everything manually issuing command line commands to compile source file, placing the compile file in a suitable directory and starting the web server using "startup" command after changing directory to C:\apache-tomcat-6.0.53\bin. I had know problem after following the directive to start (and even stop) tomcat
web server. Let me say precisely where i am experiencing problems. The book said i should build this directory tree: ch1\WEB-INF\classes under the  C:\apache-tomcat-6.0.53\webapps which eventually gave me the 
C:\apache-tomcat-6.0.53\webapps\ ch1\WEB-INF\classes directory structure. I learnt that the directory "ch1" corresponds to the name of the web app. I placed the web.xml in the WEB-INF and placed the compiled class (via DOS prompt
command) in the classes folder. I started the tomcat server via DOS prompt (after setting directory to  C:\apache-tomcat-6.0.53\bin). To indicate the correctness of this procedure a new prompt came up indicating that the server was successfully started. I loaded my browser (Google chrome) and supplied the URL http://localhost:8080/ch1/Serv1 but the response had been the error page HTTP Status 404 (no path info...). The message section showed no message
or path information(blank) only the description section indicated that the requested resource(with no resource or path information supplied) is not available. I'll appreciate anyone showing me the missing link concerning this problem. The
relevant code is supplied below to validate their correctness..

The Servlet code



web.xml code



                                                                 Olakunle Oni
 
Stephan van Hulst
Saloon Keeper
Posts: 7808
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your project might also contain a context.xml file in the META-INF directory. It's been a while since I made web-apps for Java, but I believe that the context configured in that file takes precedence over the name of your web application directory. If it exists, you can either delete it, or rename the path in the context defined in that file.

Can you doublecheck that http://localhost:8080 gives you some kind of overview of your Tomcat installation?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!