通过Spring的ResourceHttpRequestHandler.handleRequest()方法获取处理请求的状态

时间:2014-07-15 07:33:25

标签: java spring

我的代码如下:

@PostConstruct
public void init() throws IOException {
    resourceHttpRequestHandler = new ResourceHttpRequestHandler();
    resourceHttpRequestHandler.setServletContext(servletContext);
    resourceHttpRequestHandler.setLocations(... my locations here... );
}

@RequestMapping(value = "/mypath/**", method = RequestMethod.GET)
public void getResource(HttpServletRequest request, HttpServletResponse response) throws Exception {
    resourceHttpRequestHandler.handleRequest(request, response);
    /* here */
}

是否可以知道资源请求的解析是否成功(在调用方法handleRequest()之后)?

0 个答案:

没有答案