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

  • Home
  • SEARCH
  • 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 6569887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:41:14+00:00 2026-05-25T14:41:14+00:00

I have the following folder structure in my project. > src/ >>main/ >>>webapp/ >>>>WEB_INF/

  • 0

I have the following folder structure in my project.

> src/
>>main/
>>>webapp/
>>>>WEB_INF/
>>>>>pages/
>>>>>>js/

All my script files are located in js folder and my jsp page is located in pages folder.In order to include abc.js script in my jsp page I wrote the following line

<script type="text/javascript" src="/WEB-INF/pages/js/abc.js"></script>

But I got following error

"NetworkError: 404 Not Found - http://localhost:8080/WEB-INF/pages/js/abc.js"

I am using jetty server to deploy my project. For running it I am using

mvn jetty:run

If I am putting my script file directly in webapp folder and including script in following way then it is working perfectly fine.

<script type="text/javascript" src="abc.js"></script>

But I want to maintain folder structure of my project by putting all scripts in js folder.
Can somebody please tell me why jetty server is taking files located only in webapp folder?
I am using windows7

  • 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-25T14:41:15+00:00Added an answer on May 25, 2026 at 2:41 pm

    Your src is incorrect. Java Servlet specifications states explicitly that no document under WEB-INF directory will be available to the webserver. You need to place your JavaScript file outside of it.

    Usually, you place jsp files inside of it, because they’re not accessed directly. They’re accessed through a Servlet or any other web development framework in Java.

    If you want to maintain your folder structure, just put your js folder on the web archive root:

    webapp/
       js
       WEB-INF/
           classes/
           lib/
           pages/
           web-xml
    

    WEB-INF directory was designed exactly to prevent that users could access files they should not get access to, such as classes, lib directories, or web.xml deployment descriptor.

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

Sidebar

Related Questions

I have an Eclipse project with the following directory structure: MyProj >> src/main/java >>
Suppose I have the following (desired) folder structure: *CommonProject *Project#1 ----> CommonProject(link) *Project#2 ---->
I have the following directory structure of a project: Folder project in Eclipse: --folder
I have a Python project with the following directory structure: project/ project/src/ project/src/somecode.py project/src/mypackage/mymodule.py
Lets say we have the following file and [folder] structure in a project with
I have a C++ project with a folder structure something like so: root/trunk root/trunk/src/...
I have the following folder structure to my nodeunit tests for a particular project:
I have a folder structure that contains multiple javascript files, each of these files
I have a project under my management. It has the following structure: $/Code/MainSolution $/Code/Branches
I would like to have a the following structure of folders: Myproj\src Myproj\include Myproj\lib

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.