Failed to load resource the server responded with a status of 404 not found

0 votes

In order to link a CSS and a JSS File, what must a user do in order to avoid an ERROR?

CSS
<link href="../Jquery/jquery.multiselect.css" rel="stylesheet"/>
<link href="../Jquery/style.css" rel="stylesheet" />
<link href="../Jquery/prettify.css" rel="stylesheet" />

JSS
<script src="../Jquery/jquery.multiselect.js"></script>
<script src="../Jquery/prettify.js"></script>

ERROR

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/jquery.multiselect.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/style.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/prettify.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/jquery.multiselect.js 
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/prettify.js
Feb 8, 2022 in Java by Soham
• 9,710 points
2,106 views

1 answer to this question.

0 votes

In order to avoid an error while linking a CSS and JS file, the files must come under the jsp folder and hence, a user will be able to find the files there. The user must return back by a folder and then use the given algorithm:- 

<script src="../../Jquery/prettify.js"></script>

The file the user would have saved will be located in the /jsp/<somefolder>/ where the <link /> and <style /> elements are included. The user must use an absolute URL due to the reason for links being stored in a common file. Please note that while attempting to rectify the relative pathing by including a second "../" one must be aware that the /jsp where the files are stored, can be damaged. 

answered Feb 8, 2022 by Rahul
• 9,680 points

Related Questions In Java

0 votes
1 answer

How to fix the error failed to load the JNI shared Library?

You need these three things : 64-bit OS 64-bit ...READ MORE

answered Apr 19, 2018 in Java by sophia
• 1,400 points
2,606 views
0 votes
2 answers

How can I get the filenames of all files in a folder which may or may not contain duplicates

List<String> results = new ArrayList<String>(); File[] files = ...READ MORE

answered Sep 12, 2018 in Java by Sushmita
• 6,920 points
1,932 views
0 votes
1 answer

How to resolve the error: could not find or load main class?

If you are getting error: could not ...READ MORE

answered May 28, 2018 in Java by Parth
• 4,640 points
11,464 views
0 votes
2 answers

What is the easiest way to iterate through the characters of a string in Java?

There are two approaches to this: for(int i ...READ MORE

answered Aug 19, 2019 in Java by Sirajul
• 59,230 points
1,869 views
0 votes
1 answer

Presenting docket dtates inside html page by javascript

Use the Docker Engine Api:Docker Engine API ...READ MORE

answered Jun 20, 2018 in Docker by DareDev
• 6,890 points
749 views
0 votes
1 answer

Migrating proxy npm repo in nexus 3

I don't think you can achieve this ...READ MORE

answered Jun 22, 2018 in DevOps Tools by DareDev
• 6,890 points
1,533 views
+1 vote
1 answer

What is the difference between JavaScript and Java

This quote rightly explains that 2 totally ...READ MORE

answered Jun 29, 2018 in Java by Daisy
• 8,140 points
795 views
0 votes
1 answer

Using setTimeout to delay timing of jQuery actions

To answer your question, the .html() only ...READ MORE

answered Feb 9, 2022 in Java by Rahul
• 9,680 points
1,899 views
0 votes
1 answer

How to split a string in Java

By using the appropriate method, this can ...READ MORE

answered Feb 9, 2022 in Java by Rahul
• 9,680 points

edited Jul 6, 2023 by Khan Sarfaraz 749 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP