0055 不能同時訪問靜態資源和動態資源的問題

2022-04-06 10:54:11 字數 336 閱讀 7131

找了些資料都說,如果把web.xml中將dispatcherservlet配置為攔截所有請求,包括靜態和動態的,像下面這樣:

springmvc

org.springframework.web.servlet.dispatcherservlet

contextconfiglocation

1/

我這樣配置了,卻導致靜態和動態資源不能同時訪問,最後還是搜尋英文資源,才在stackoverflow上解決了問題:

配置的處理器對映器和處理器介面卡,就沒用簡化的

最後:找資料,還得上google找英文的

springMVC訪問靜態資源

web.xml springmvcservlet name org.springframework.web.servlet.dispatcherservletservlet class contextconfiglocationparam name classpath config spring s...

SpringMVC 靜態資源訪問

首先要談在使用web層框架時,都會配置乙個 而 的url pattern有以下幾種 1.攔截所有 jsp js png 全攔截 不建議使用 2.action do 攔截以 action 或者以 do 結尾的請求 3.攔截所有,不包含jsp 包含js png css 建議使用 因此,一般情況下都會使用...

express訪問靜態資源

dirname 表示當前檔案所在的目錄的絕對路徑 filename 表示當前檔案的絕對路徑 module.filename filename 等價 process.cwd 返回執行當前指令碼的工作目錄的路徑 process.chdir 改變工作目錄 const express require exp...