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 3322352
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:10:18+00:00 2026-05-17T23:10:18+00:00

We have a web app with the following folders/files: somefolder\ view1.jsp view2.jsp We also

  • 0

We have a web app with the following folders/files:

somefolder\
view1.jsp
view2.jsp

We also have a servlet that is configured as follows:

<servlet>
    <servlet-name>Servlet1</servlet-name>
    <servlet-class>com.etc.Servlet1</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Servlet1</servlet-name>
    <url-pattern>/somefolder/</url-pattern>
</servlet-mapping>

The desired result is:

  • Navigate to http://some.site/somefolder <– should be handled by com.etc.Servlet1
  • Navigate to http://some.site/somefolder/view1.jsp <– should be handled by the jsp processor

On our live Tomcat 5 site, the above works fine. On our development Tomcat 6 systems, the above works fine.

But on our new live Tomcat 6 site, the above doesn’t work. I get 404 errors when navigating to http://some.site/somefolder

If we rename the somefolder\ folder in the filesystem to be somefolder2\ , then the servlets work properly.

Given the difference between behavior of different installations, this makes me wonder if it doesn’t have to do with Tomcat configuration – maybe Tomcat is seeing the physical directory, and handling that with some other servlet (the Default servlet maybe??), and never giving our servlet-mapping a chance.

Does anyone have any suggestions on how to attack this?

EDIT: More information:

Digging in a bit, I’m finding that by JNDI resources are not available for jsp files in any sub-folder, but the JNDI resources are available in servlets configured in web.xml. It looks like maybe Tomcat is creating separate contexts for each sub-folder. Is that possibly what’s going on?

EDIT: More info:

I added a debugging line that displays the context path, and sure-enough – the jsp files in the sub-folder are indeed running in their own context. So how could Tomcat be implicitly creating contexts for each sub-folder in the web app? We definitely aren’t creating these context’s ourselves.

  • 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-05-17T23:10:19+00:00Added an answer on May 17, 2026 at 11:10 pm

    The solution here was to leave the webapp path set to the default location, and specify special folders for each context (under Tomcat 4, you could do this by setting the webapp location, but the behavior has, apparently, changed).

    Easy enough fix.

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

Sidebar

Related Questions

I have configured in following way that spring MVC app using Spring 3.1.1.RELEASE web.xml
In the web.xml of my web app I have configured the server as following:
I have a PHP app running happily on the following system: web app: PHP
I have an input box in my web app, If I type the following
I have a JavaScript data structure like the following in my Node.js/Express web app:
I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database
I have a web app that runs fine in Visual web developer. But when
I have a web app built with html5 boilerplate that has multiple skins available.
I have an application setup with the following Package/Publish Web settings: Only files needed
I have a web app that has search functionality. The search algorithm is compiled

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.