Solved

Servlet help needed

Posted on 2003-11-05
5
211 Views
Last Modified: 2010-04-01
I have the a.java and a.class file in this path
"C:\Program Files\jakarta-tomcat-4.1.27\webapps\examples\WEB-INF\classes"

I have installed Tomcat 1.4.27. I used the following link in my browser:
"http://localhost:8080/examples/servlet/a"

It is working as expected.
But my doubt is, there is no folder named "servlet" under "examples" folder. Instead a folder named "servlets" is only seen within "examples" folder. When i tried "http://localhost:8080/examples/servlets/a" link it is returning 404 error.

I don't understand the process. Please help me.


Thanks,
Navanee

0
Comment
Question by:rnavanee
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
Comment Utility
examples is the webapp name

servlet is a shortcut for tomcat to look the servlet up in it's WEB-INF/web.xml file

it isn't a directory
0
 

Author Comment

by:rnavanee
Comment Utility
Ok. I got it.

But there are lot of folders under the "webapps" folder. Can anyone explain them in detail. I get confused while dealing with these folders. I don't know where to place the servlet source code, JSP code ...

Thanks again
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
ROOT is set up as the default pages; ie:

http://localhost/index.html

will be inside ROOT

the others are the other webapps that come with tomcat:

http://localhost/examples/index.html

is inside the examples webapp

if you look inside server.xml (in the conf directory), you can see how these are set up for logging, etc

If you want your servlet to run as:

http://localhost/servlet/MyServlet

then put the class for your servlet in

webapps/ROOT/WEB-INF/classes

that should do it...so long as your class isnt inside a package...

Tim.
0
 

Author Comment

by:rnavanee
Comment Utility
Thank you for the explaination.
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
:-)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Run the project 5 82
logging jar 1 104
Fisheye tool 2 101
TreeSet comparator example 7 87
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now