• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Web Application Folder

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Servlets, while everything is working fine when I placed servlets in ROOT folder in webapps.
But when I create my own folder in webapps, and place all files in that, it is not working and giving the following error message:
Apache Tomcat/4.0.1 - HTTP Status 404 - /Raja/hai.html
--------------------------------------------------------------------------------
type Status report
message /Raja/hai.html
description The requested resource (/Raja/hai.html) is not available.
--------------------------------------------------------------------------------
Thanks in advance.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did u configure web.xml to map ur servlet classes to urls?
 
Raja Vadlamudi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did mapping something like
<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
but before than that, I am just trying to make a normal .html file work which has nothing to do with web.xml, like
http://localhost:8080/Raja/hai.html
Even this is giving an error.
Thank you.
 
Kelvin Hung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did u put ur folder under ROOT or webapps? ROOT is the "root" of ur server, any folder above it is not accessible. So Root/Raja/ is ok, but webapps/Reja/ is not ok.
 
Raja Vadlamudi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the folder is webapps/Raja. I am not sure why this is not ok. The other folders like examples, manager, tomcat-docs, webdav work fine even if they are not under ROOT and are just under webapps?
 
Kelvin Hung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In C:\Tomcat\conf\server.xml. It has a element called
<Context path="" docBase="ROOT" debug="0"/>
So if you want to run the example, you need to change that to example.
So in your case, you can try to change the docBase to Raja.
 
Raja Vadlamudi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
The above lines are from conf/server.xml , they are commented. I removed comments and then put Raja in place of ROOT, even then it didnt worked and now even ROOT didnt started working.
So I commented them back and added one more Context path with docbase="Raja", even now it is not working.
 
Kelvin Hung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Raja Vadlamudi:
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
The above lines are from conf/server.xml , they are commented. I removed comments and then put Raja in place of ROOT, even then it didnt worked and now even ROOT didnt started working.
So I commented them back and added one more Context path with docbase="Raja", even now it is not working.


Does your url include /Raja?
My guess is when docbase is Raja, you don't need /Raja in your path. Try
http://localhost:8080/hai.html
 
Raja Vadlamudi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
neither of them worked.
 
Get off me! Here, read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic