When the SPRINGMVC is set up, the configuration file is all right, the project runs successfully, but the HTTP request is not answered, and the log is viewed because there is no controller for the URL, first check that the controller has not been instantiated, and then found that no, Because there is no related package to introduce Spring-bean, OK careless .... But after the introduction, or the same error, find to find no flaws ah, look for Niang ... Finally found:
<mvc:resourcesMapping= "/images/**" Location= "/web-inf/images/"Cache-period= "31556926"/> <mvc:resourcesMapping= "/js/**" Location= "/web-inf/js/"Cache-period= "31556926"/> <mvc:resourcesMapping= "/css/**" Location= "/web-inf/css/"Cache-period= "31556926"/>
Yes, this is the addition of these sentences in the config file, which causes the controller annotations to fail, but why does the controller annotations fail and the controller class can be instantiated by spring?
Finally, the sentence is removed, run, perfect.
But these sentences are used to help static resources escape SPRINGMVC's parser, removing the seemingly not-so-good, workaround:
Add a sentence to these sentences:
</>
I use annotations, spring you need to find annotations .....
In addition to this, there is a workaround, is to declare the path of the static resource in Web. XML to be implemented by the default servlet, is OK, is a bit of trouble
SPRINGMVC parser cannot map the URL of a controller configuration