請幫我解決以下問題!我的配置:<mvc:resources>和PathVariable
<mvc:resources location="/images/" mapping="/images/**"/>
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:resources location="/javascript/" mapping="/javascript/**"/>
,一切就像是工作的罰款,我的資源請求:
http://127.0.0.1:8080/baraholka/viewAdverts.brh
,但是當我有這樣的要求:
http://127.0.0.1:8080/baraholka/viewTagAdverts/tag/2/1
其中:
@RequestMapping(value="/ajaxViewAdverts/tag/{id}/{currentPage}", method=RequestMethod.GET)
public ResponseEntity<byte[]> viewTagAdverts(@PathVariable("id") Integer id, @PathVariable(value="currentPage") Integer currentPage, ModelMap map, HttpServletRequest request, HttpServletResponse response){
byte view[] = {};
HttpHeaders httpHeaders = new HttpHeaders();
我得到:
20:48:08.109 WARN [http-8080-4] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/javascript/jquery.cookies.2.2.0.js] in DispatcherServlet with name 'baraholka'
20:48:08.109 WARN [http-8080-3] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/javascript/baraholka.js] in DispatcherServlet with name 'baraholka'
20:48:08.140 WARN [http-8080-1] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/javascript/jquery.lightbox-0.5.min.js] in DispatcherServlet with name 'baraholka'
20:48:08.156 WARN [http-8080-5] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/javascript/jquery.ui.stars.js] in DispatcherServlet with name 'baraholka'
20:48:08.156 WARN [http-8080-2] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/css/jqcloud.css] in DispatcherServlet with name 'baraholka'
20:48:08.171 WARN [http-8080-3] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/images/login.png] in DispatcherServlet with name 'baraholka'
20:48:08.171 WARN [http-8080-1] org.springframework.web.servlet.DispatcherServlet:947 - No mapping found for HTTP request with URI [/baraholka/viewTagAdverts/tag/2/images/logo.png] in DispatcherServlet with name 'baraholka'
如何設置正確的映射?我也試圖做這樣的映射,如/images/,但它不起作用。
請求映射針對的是/ ajaxViewAdverts/...,但請求是針對/ viewTagAdverts/... –