Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:37:35+00:00 2026-06-02T03:37:35+00:00

I have searched high and low for an answer/tutorial on this with no joy.

  • 0

I have searched high and low for an answer/tutorial on this with no joy. It must be too trivial a question.

I’ve installed Tomcat 7.0.27 and am messing around with the stock examples. The examples are stored in webapps/examples and server.xml says the docBase is webapps. The HTML index of the examples is accessed via http://localhost:8080/examples/servlets/. So far, so good.

On this page, hover over the “Execute” link for the “Hello World” servlet and the path expands to: http://localhost:8080/examples/servlets/servlet/HelloWorldExample, which executes successfully of course. But servlet is supposed to expand to WEB-INF/classes. So I would expect the on-disk path to the class to be webapps/examples/servlets/WEB-INF/classes/HelloWorldExample.class, which it is not. The actual path is webapps/examples/WEB-INF/classes/HelloWorldExample.class. The only thing that’s in the servlets directory is HTML and image files. Question #1: What’s up with that? How did examples/servlets/servlet get re-routed to examples/WEB-INF/classes?

Question #2: I drop a compiled class Foo.class into WEB-INF/classes and try to access it both through http://localhost:8080/examples/servlets/servlet/Foo and through http://localhost:8080/examples/servlet/Foo. Both produce 404 not found. Restarted Tomcat (shouldn’t have to, but what the hay) which didn’t help. What gives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:37:36+00:00Added an answer on June 2, 2026 at 3:37 am

    Doesn’t work like that. Servlets != CGI. There is no expansion.

    Servlets are specifically mapped in the web.xml to their URL. Their package name, or placement within WEB-INF as a .class, in a .jar, or located some other place on the class path have no bearing on what URL they are mapped to.

    Addena, in Servlet 3.0, they can be annotated instead of mapped in web.xml. That doesn’t mean necessarily that compiled classes can be “just dropped in”. That would be a container feature, I can’t say whether Tomcat would allow that or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive searched high and low on this one. I don't have PowerCommands installed as
I have searched high and low for documentation on how to use this feature.
I have searched this question but didn't get / or understood the answer I
I have searched high and low for an answer to why query results returned
I have searched high and low, but I can't figure this one out. I
I have searched high and low for a clue to or even the answer
I've searched high and low for the answer to this, but I can't figure
I have searched high and low for documentation on this, but I just cannot
I have searched high and low to no avail, and this is last step
I have searched high and low and tried multiple different solutions to this and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.