0
我使用Spring MVC的控制器如下產生的javascript:如何爲JavaScript資源設置Spring MVC視圖解析器?
@RequestMapping(value="path/to/handler", method = RequestMethod.GET, produces ="text/javascript")
public ModelAndView getJs(HttpServletRequest request) {
String contextPath = request.getContextPath();
return new ModelAndView("/path/to/js/", "contextPath", contextPath);
}
我不知道如何設置的視圖解析爲JavaScript的資源,但。有人可以請建議如何建立一個JS資源的視圖解析器?
您還可以映射favicon.ico和其他資源(如圖像等),如上所示... –
您的意思是說我不需要視圖解析器當我從Spring生成一個JS資源? – balteo