Tag Archives: Failed to load resource

[Solved] Failed to load resource: the server responded with a status of 404 ()

Failed to load resource: the server responded with a status of 404 ()

There is a problem with server compilation. Some resources are not compiled in the server compilation and packaging, resulting in no accessed resources in the server.

Solution:

1. Put the resources that cannot be scanned into the corresponding location of the out folder

For example:

Put the folder at (1) on (2)

Method 2:

Repackage

How to Fix Failed to load resource: the server responded with a status of 404()

Problem: Failed to Load Resource: The server required you with a status of 404 () In SpringMVC, you might encounter a page access 27) and discover that all static resources are 27) blocked because all static resources are 27) blocked by default (JS, CSS). HTML, image, video, audio) for static resources, you need to manually configure the static resource filter.
Solution:
The first:
web.xml

<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.jpg</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.js</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.css</url-pattern>
</servlet-mapping>

The second:
spingmvc.xml

<!-- Accessing Static Resource Configuration -->
    <mvc:resources location="/static/" mapping="/static/**" />