Troubleshooting Problem with CSS Display in Spring Security 3.2

After deciding to integrate 'Spring security 3.2.0' into my current web application, which was originally developed without Spring and utilizes Primefaces & EJB 3, I encountered a challenge.

Upon starting the basic configurations, I noticed that the page was displaying without CSS styles. The log snippets below provide some clues regarding the issue at hand. Unfortunately, I'm unsure of what exactly is missing in this setup.

Your assistance with resolving this matter would be greatly appreciated.

Application Logs:-

            05-02-2014 16:05:58 INFO  DispatcherServlet:472 - FrameworkServlet 'spring': initialization completed in 831 ms
            05-02-2014 16:05:58 DEBUG DispatcherServlet:141 - Servlet 'spring' configured successfully
           ... (log continues)

spring-security.xml

            <beans:beans xmlns="http://www.springframework.org/schema/security"
                xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="... (truncated for brevity) ...>
               ... (XML code lines continue)

spring-servlet.xml

            <beans xmlns="http://www.springframework.org/schema/beans"
                xmlns:context="http://www.springframework.org/schema/context"
                xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="... (truncated for brevity) ...>
              ... (XML code lines continue)

web.xml

            <?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">
              ... (XML code lines continue)

Answer №1

What happens if you take out resources from the path?

<security:http pattern="/css/**" security="none"/>
<security:http pattern="/images/**" security="none"/>
<security:http pattern="/js/**" security="none"/>

Answer №2

When I encountered a similar issue, I was able to resolve it by removing the double asterisk mark in (location="/css/**"). By defining a folder within the Web-content directory to store my resources, the problem was fixed.

<mvc:resources mapping="/resources/**" location="/assets/"/>`

Here is the folder structure: application_name-->WebContent-->assets-->css

For JSP CSS URLs:

 <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/bootstrapStyles.css"/>"></link>
<script src="<c:url value="/resources/js/jquery-1.12.0.js" />"></script>

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

The dynamic loading of an HTML/JavaScript input range object within a div is not functioning properly

Hey there, I have a hidden div containing a range input: <div id="hiddencontainer" style="display:none;"> <input id="range1" type="range" min="1" max="10" step="1" name="rating" value="1" onmousemove="showrangevalue()"/> </div> The ...

Creating an executable from a test file located in a separate directory within the current folder

I am facing an issue with compiling a test file in Java with the files Triangle.java and TriangleTest.java located in different folders. The directory structure is set as C:\Users\A\Desktop\NewPrograms, organized into separate folders f ...

Is there a way to keep the spotlight/shadow position fixed in relation to the horizontal center, regardless of the zoom level?

After working on the following code snippet, I've managed to keep the spotlight centered horizontally, except when the zoom factor is too high. This means that when I zoom in, the spot light no longer remains centered in the horizontal view port. It& ...

Error encountered when trying to show a modal using a PHP script

I'm encountering an issue with the modal system on my website. Let me share some code snippets: MODALS ARE BUILT WITH W3.CSS LIBRARY modal.js (including debug statements) let modal = null; let title = null; let content = null; $(document).ready(() = ...

Utilizing the NG-CLASS directive within a material table to target a specific 'row' element for styling in CSS

I have a table with various columns, one of which is a status field. I am looking to display colored badges in that column based on the status of each record, which can be "Completed", "Deleted", or "Canceled". I have attempted to use ng-class to dynamical ...

Customizing Bootstrap modal backdrop with CSS

I'm exploring how to achieve the backdrop effect of the Bootstrap modal without actually having to load a modal. However, I'm struggling to make it work correctly. Can anyone provide insight into the CSS that the Bootstrap backdrop utilizes inter ...

Distinguish a specific div within a group of divs by styling it uniquely using just CSS and HTML

I need assistance in selecting the first div with both "con" and "car" classes among all the divs using a CSS selector. <div class="box"> <div class="con">1</div> <div class="con be">2</div> <div class="con car">3& ...

Display a dropdown menu when clicking on a close button in a single element using Vanilla JavaScript

I'm currently in the process of learning Javascript and trying to grasp the concept of events and selectors. My aim is to have a close button that, when clicked, triggers a specific dropdown related to the card it's attached to. I plan to achie ...

Obtain the URL link from Unsplash where the picture is sourced

As I work on a website, I incorporate a link () to display a random photo. However, the photo refreshes periodically and upon loading the site, all that is visible is this default link: . Is there a method to extract the actual source like so: "". Althou ...

Halt the present thread upon mutual exclusion detection

Within my android Application, I have a specific method in one of my MODEL classes that is always called from a thread separate from the UI thread. The AlarmManager runs this method periodically, and users also have the option to trigger this method from ...

React JS tutorial: deleting an entry from the browser's localStorage

I am currently working on an App that fetches data from an API and updates it randomly every 3 seconds. The user has the ability to print the data by clicking a button, which can also be used to stop the random updates. I have managed to implement this fun ...

What causes the unset width or height to impact object-fit, and is there a workaround for this issue?

Query Beginnings Encountering unexpected behavior while using the value unset with the rule object-fit led me to question if there might be a rationale or workaround for this peculiar issue. Demonstration .block { &__img { width: 100%; hei ...

Increasing and decreasing the display of content using JQuery based on height rather than character count

I'm attempting to create a show more/show less link with a set height of 200px that, when clicked, will reveal the rest of the content. Anything exceeding 200px will be hidden, and there will be a "show more" link to display the remaining text. I&apos ...

Tips for confirming all the elements on a single page with Data Table

Seeking guidance on how to locate every element within the same page and programmatically confirm their visibility using a Data table in Selenium, Java, or Cucumber. Consider a hypothetical situation like this Scenario: Validate all elements in the xyz p ...

Is there a universal method to generate an immutable List/Set/Map from a Collection/List/Set... structure?

The Java util Collections class offers a way to create an "unmodifiable" decorator around any existing list. However, this decorator is just around the original list that was passed into the call. The decorated list cannot be changed, but it will change un ...

Parsing problem encountered with an empty string field in Univocity parser

When parsing fixed width data with multiple lookahead, encountering an empty string (e.g., fieldX=' ') can lead to issues. Specifically, in a fixed format file containing only 2 records, if the first record's last field is an empty string ...

Linux causing Chrome driver to crash upon startup

package webapp; //import java.sql.Driver; //import java.util.*; //import org.openqa.selenium.*; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class app { public static void main(String[] args) { ...

Tips for transforming a scroll element into the viewport using Angular 2+

This is a sample Here is a component with a list of items: class HomeComponent { text = 'foo'; testObject = {fieldFirst:'foo'}; itemList = [ '1', '2', '3', & ...

Scrollbar visibility issue

Recently, I came across a curious behavior regarding browser scrollbars. To see it in action, check out this link. HTML: <div class='container'> <div class='fix' /> </div> CSS: body { margin: 0; } .container ...

The Bootstrap navbar collapse fails to expand in the appropriate location

Whenever I try to expand the navigation on mobile mode by clicking the button, it doesn't push the content downwards. Instead, it just opens a small menu next to the button. Did I make a mistake in my code? <div class = "container"> ...