Solved

Servlet help needed

Posted on 2003-11-05
5
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 9686107
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
ID: 9686418
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
ID: 9686459
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
ID: 9686568
Thank you for the explaination.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9686653
:-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Learn why we support net neutrality and why the topic is important to all internet users.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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