wood burning stoves*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Running Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Running Servlet" Watch "Running Servlet" New topic
Author

Running Servlet

Salima Lalani
Ranch Hand

Joined: Aug 15, 2002
Posts: 59
Hi,
I have started reading the Hanumant's guide from last 3 days. When we run servlet , say http://localhost:8080/chapter01/servlet/HelloWorldServlet , why we give the servlet as a directory under chapter01. There is no direcory called servlet in web-inf direcory. Can somebody help me to understand this?
Thanks
Salima
Jacky Chow
Ranch Hand

Joined: Sep 01, 2002
Posts: 63
hi,
"chapter01" here is the define by servlet/jsp container, it is not define in *.war file.
for example, in tomcat, "chapter01" is the parent directory of your web application.


Jacky
Dharmin Desai
Ranch Hand

Joined: Feb 28, 2002
Posts: 81
Dear salima,
Actually yr web-inf directory and its all folders r Private where as rest of all folders r for public use.
The mean to say as private to container b'coz an application can not link to directly these resources (within Web-inf).
Moreover, web-inf/classes directory is mapped(or refered - alias) as servlet directory in a container.
So when ever link has like "http://localhost:8080/chapter01/servlet/HelloWorldServlet, container will search in a web-inf directory of chapter01 docbase.
With best regards, Dharmin


SCJP2 (93%),SCWCD(88%)<br />-------------------------------<br />Never under estimate yr self, just represent yr profile in proper manner.
Salima Lalani
Ranch Hand

Joined: Aug 15, 2002
Posts: 59
Thanks a lot!!
Salima
Sudd Ghosh
Ranch Hand

Joined: Oct 23, 2002
Posts: 187
In Tomcat, the /servlet/ mapping is done by the "invoker" servlet in the global web.xml file present in install_dir/conf directory. However, this mapping can be overridden in our local web.xml file's servlet-mapping section.
Thanks.


SCJP 1.4, SCWCD, SCBCD 1.3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running Servlet
 
Similar Threads
Beginners ques- servlet not deploying
Servlet beginners question
basics of web.xml
Help. Tomcat installed - can't see servlet
Can not run a servlet class