o.s.web.servlet.PageNotFound : No mapping for GET
出現(xiàn)這種情況主要原因是springMVC配置類出了問題
springMVC默認(rèn)會(huì)將所有的靜態(tài)資源攔截,所以需要重寫,并放行
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
}
同時(shí)確保已經(jīng)配置好了properties中的配置文章來源:http://www.zghlxwxcb.cn/news/detail-794588.html
#訪問靜態(tài)資源路徑
spring.mvc.static-path-pattern=/static/**
spring.web.resources.static-locations=classpath:static/
然后就可以愉快的訪問了文章來源地址http://www.zghlxwxcb.cn/news/detail-794588.html
到了這里,關(guān)于o.s.web.servlet.PageNotFound No mapping for GET的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!