A little knowledge of URL mappings for Web.xml in Springmvc and struts2:
The STRUTS2 filter only accepts requests for no suffix or suffix action, Strutsprepareandexecutefilter url-pattern best Configured "/*"
The SPRINGMVC servlet is to configure "/" to handle other URL requests except for the. JSP suffix name, as well as static files (such as. css,.js.png)
SRINGMVC handles static resource access scenarios:
Objective: Static file can be accessed normally, no static file 404 can be found.
Scenario One: Activate Tomcat's defaultservlet to process static files
Features: 1. To configure multiple, each file is configured with one.
2. to write in front of the Dispatcherservlet, let Defaultservlet first intercept the request, so that the request will not enter Spring .
3. High performance.
Note:
Name of the default servlet with Tomcat, Jetty, JBoss, and GlassFish--"Default"
Google App Engine's default servlet name-"_ah_default"
Resin the name of the default servlet--"Resin-file"
WebLogic the name of the default servlet--"Fileservlet"
The name of the default servlet with WebSphere--"Simplefileservlet"
Programme II: Mvc:resources is available after the spring3.0.4 version, using the following methods:
images/** maps to Resourcehttprequesthandler for processing, location specifies the location of the static resource. Can be the Web application root directory, jar package, so you can compress the static resources into the jar package.
Programme III, using
"/" is used to indicate that the corresponding servlet is to apply the default servlet, and "/*" is used to indicate that all paths will be blocked by this servlet
<url-pattern>/</url-pattern> does not match a suffix-type URL (but. css,,.js,.html match) with a pattern of *.jsp. If the corresponding servlet or filter is not found, it goes into the default Serlvet or filter
with the matching path configured as "/" <url-pattern>/*</url-pattern> Matches all URLs: path-and suffix-type URLs (including/login,*.jsp,*.js and *.html, etc.)