ssm static resource acquisition

QUESTION: Well xml configuration file, start tomcat, jsp page request was successful, but the static resource request has failed 404,

The reason: the configuration in web.xml:

In the beginning of time due to the configuration of the <url-pattern> / </ url-pattern>, with the result that all requests are intercepted, including static resources,

The above is configured to use later, do not wrong

 

Solution: a:

The reason: In the tomcat server comes with a default servlet, called "DefaultServlet", web.xml can be found in its configuration,

It is declared in the configuration, the configuration of the xml when you can not get static resources, they can use the default servlet, as shown above,

Note that different a different server that comes with the default servlet, called the DefaultServlet only in the tomcat.

 

two:

 

 three:

The path of each resource are written into it, but too much trouble

four:

According to the first picture configuration, but will be added .do in all non-static requests or requests fail

 

Guess you like

Origin www.cnblogs.com/dlxbk/p/10960556.html