Unable to load CSS after modifying website's URL

Recently, we made a significant change to our website's URL. We switched from a long and complex URL like www.example.com/portal/public/media/12345 to a more concise one at www.newsite.com/12345.

However, after the URL restructuring, I noticed that the CSS is no longer loading properly. Is there something specific that I should add or remove in my JSP files to rectify this issue?

The way I am currently accessing the CSS in my JSP files is as follows:

<link href="/resources/portal.css" rel="stylesheet" />

It's worth noting that the resources folder is located under the web/webroot directory.

Error Log: WARN 31 Jan 2018 13:43:08,694 () [PageNotFound] - No mapping found for HTTP request with URI [/portal/public/media/portal/resources/portal.css;jsessionid=799088F1EB2D765BAF6B5AB0F62364FC.tcserver0] in DispatcherServlet with name 'portal'

Additionally, when checking the console in the Chrome browser, I encountered the following error code: GET newsite.com/portal/resources/… net::ERR_AB

If anyone could provide assistance with resolving this issue, it would be greatly appreciated.

Answer №1

After some tweaking, we decided to switch the mapping of the new website to www.sample.com/portal instead of www.sample.com/portal/public/media. This simple change successfully resolved the problem.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Incorporate a linked select dropdown into the registration form

I am working on a sign-up form and trying to integrate 2 linked select boxes into the form. The code for the linked select boxes works fine separately but when I attempt to add it to the form, it doesn't display as expected. I attempted to incorporate ...

Learn how to use an Angular Directive to automatically set the default value within an HTML Text box element. The code snippet provided below will guide you

I have encountered an issue with the code below. It seems to be working fine for changing the innerHTML of div and heading tags, but I am facing difficulties when trying to apply it to textboxes. @Component({ selector: 'app-root', template: ...

What is the best way to create a centered vertical line with text in the middle?

I attempted to replicate a form that contains a vertical line <span class="vertical-line">or</span> with text centered in it! How can I create a similar appearance like this form? I considered using hr but it generates a horizontal ...

Capture HTML content as a string in Metor and then transform it into a DOM element at a later time

I need to store a string, such as "<div class='some_class'>some content</div>", in a mongo document. Later on, I want to retrieve this content and convert it into a DOM node. What is the best way to manipulate the content before inse ...

Creating equal spacing between divs and the edges of the container

I need to arrange a set of divs equidistant from each other. My goal is to have the maximum number of divs fit side by side with equal spacing between them and the container edge. While I almost achieved this with the code below (credit to another post), ...

Animate an svg icon to follow a designated path as the user scrolls

I am currently working on a project that involves animating a bee svg icon as the user scrolls through the website. The bee starts at the top and fills in a grey color line with pink as the user moves forward, and moves backward as the user scrolls back. Y ...

Transferring data between AngularJS and non-AngularJS environments

Within my AngularJS application, the $scope.mydata variable holds some important data within a controller. I am currently working on a regular JSP page without any AngularJS functionality, but I need to access the data stored in the scope variable (mydat ...

Centered CSS navigation bar without any spacing between the buttons

Good evening everyone, I am looking to create a navigation bar that is centered on the screen with no gaps between the buttons. I have tried using 'float:left' to close the gaps, but this aligns the navigation bar to the left. Without 'floa ...

Is there a log for keeping track of any CSS errors that occur

When a style is overridden in Google Chrome tools, it gets crossed out and you can check the Computed tab to see which element has taken precedence. Imagine I have CSS code like this: .myClass { position: static; top: 20px; } This is incorrect be ...

"Troubleshooting issue with PHP code not running in a specific project within XAM

For some reason, the PHP codes are not parsing correctly and are just displaying as they are on the page. I am using xampp for this project, and all other projects on the same server are working fine. I have made sure not to use short tags like <?. I ...

Issue with Date Formatting in Timeago Jquery Plugin

Let's dive in: I'm currently working on integrating the timeago jQuery plugin (http://timeago.yarp.com/) into my project to display relative time (e.g. "2mins ago" instead of "1.10pm"). In my MySQL database, there is a field that stores the curre ...

Tips for embedding dynamic JSP pages from a different server into your own JSP page

I'm currently working on a project where I need to dynamically incorporate an HTML snippet into a webpage. The course information is stored on one server, and I want other servers to be able to include it using just a single line of code. If the file ...

Incorporate a course within the conditional statement

Currently, I'm working on the development of an input site and one of my goals is to highlight empty fields. My plan is to check if a field is empty using an if statement and then apply a specific class that will serve this purpose. This is the JavaS ...

When hovering over one div, both it and another div should be displayed simultaneously. The second div should continue to be displayed even when hovered over

I am looking to keep another div displayed when hovering over it - in this example, it says "hello." The div I want to remain visible is not a child element of the main div where I initiate the hover event. document.write("<base href=\"" + docum ...

Upon clicking on another div, command it to expand to full height and width

I am encountering an issue when loading an HTML file into a content div after clicking on a menu bar option. The HTML file contains 5 tables, but the div only displays the first 5 lines of the first table before requiring a scroll bar to view the rest of t ...

Create a layout with four columns, ensuring that each set of two columns has equal heights

Trying to create a container with two columns, each containing two columns of their own, all with equal heights using only CSS. The issue: the inner columns in their parent column do not align with the other inner columns in their respective parent column ...

Utilize jQuery and JSP (or PHP) to showcase detailed information about a specific item when a user clicks on it within an HTML page

For my upcoming college project, I am tasked with developing a movie library. The main page of the library will feature various movie posters. Upon clicking on a poster, users will be directed to a dedicated page displaying detailed information about the ...

Combining Three.js with iFrame for a mix of WebGL and CSS3D

After some experimentation, I successfully created a dynamic page that seamlessly integrates WebGL and CSS3D (with valuable guidance from this helpful SO post). To add an extra touch, I included an iframe: However, I noticed that the functionality to inte ...

Tips for saving and editing a file with JavaScript

I need a website visitor to input text into a text area on my site. When they submit the form, I want the entered text to be saved in a .txt file located in the same directory as the current web page. I am unsure of how this can be accomplished, and if i ...

Using the .val method on an input element modifies the HTML content without affecting the value displayed

Currently, I am working on validating the range input type by utilizing JavaScript along with jQuery's val method. While it successfully displays the output in HTML, I encountered an issue where changes to the value are not being logged in the console ...