Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Servlet help needed

Posted on 2003-11-05
5
Medium Priority
?
217 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

WooCommerce is becoming the most powerful e-commerce plugin for Wordpress. And why not. The platform comprises of numerous core plugins that may come in handy, powerful options to make your website development task much easier.
What monsters are hiding in your child's room? In this article I will share with you a tech horror story that could happen to anyone, along with some tips on how you can prevent it from happening to you.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

609 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