Solved

Servlet help needed

Posted on 2003-11-05
5
212 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

26 Experts available now in Live!

Get 1:1 Help Now