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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:13:47+00:00 2026-06-06T04:13:47+00:00

I am sure I am making some crazy mistake but unable to figure it

  • 0

I am sure I am making some crazy mistake but unable to figure it out. I just installed Tomcat 7.0 and deployed “app” that just consists couple of JSPs (simple test). However, when I run tomcat and try to access the pages, I can only access JSP if I put it in “welcome-file-list” and can not access it any other way. Could someone help as I am unable to figure out what am I doing wrong.

Here is the webapp structure –

sampleapp -
   /META-INF
   /javascripts
   /stylesheets
   /WEB-INF
      web.xml
      /lib
      /classes
      /jsp
         /test1.jsp
         /test2.jsp

Here is the web.xml. It really doesn’t have anything except for the welcome-file-list –

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>sampleapp</display-name>
  <servlet>
    <servlet-name>default</servlet-name>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
      <param-name>fork</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>xpoweredBy</param-name>
      <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    <url-pattern>*.jspx</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>/WEB-INF/jsp/test1.jsp</welcome-file>
  </welcome-file-list>
</web-app>

In this example, I have welcome-file set to test1.jsp so when I run tomcat and access default app as http://localhost:8080/sampleapp, it loads the content of test1.jsp successfully. However, if I try to access the path for test2.jsp I am unable to do so. Similarly, if I set welcome file to be test2.jsp, I can access it by simply accessing http://localhost:8080/sampleapp but when I try to explicitly access test1.jsp or test2.jsp, it returns 404 error.

Could anyone help figure out whats going wrong?

  • 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-06T04:13:49+00:00Added an answer on June 6, 2026 at 4:13 am

    The WEB-INF directory is inaccessible from the outside. If you want the JSPs to be accessible from the outside, you must put them outside of WEB-INF.

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

Sidebar

Related Questions

Sorry, I'm sure making a silly mistake, but did not work out. I'm compiling
I'm sure I'm making some kind of silly mistake here, but when converting a
I'm going through some old C#.NET code in an ASP.NET application making sure that
I'm going through some old C#.NET code in an ASP.NET application making sure that
I've been making some objects using the pimpl idiom, but I'm not sure whether
I'm making some changes to a bit of our app that parses a csv
The following is some code for making sure people can't submit if the value
I pushed my app to heroku after making sure it works fine in my
I'm accessing a database in steps, and making sure that I dispose of all
What's the best practice for making sure that certain ajax calls to certain pages

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.