Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Post方法PDF在Spring 3.0控制器中无法下载 你有错误吗?还是空白页?您看到了什么行为?在响应体中获得响应而不是pdf下载。 @RequestMapping(method = RequestMethod.POST, value = "/down_Java_Spring Mvc_Pdfbox - Fatal编程技术网

Java Post方法PDF在Spring 3.0控制器中无法下载 你有错误吗?还是空白页?您看到了什么行为?在响应体中获得响应而不是pdf下载。 @RequestMapping(method = RequestMethod.POST, value = "/down

Java Post方法PDF在Spring 3.0控制器中无法下载 你有错误吗?还是空白页?您看到了什么行为?在响应体中获得响应而不是pdf下载。 @RequestMapping(method = RequestMethod.POST, value = "/down,java,spring-mvc,pdfbox,Java,Spring Mvc,Pdfbox,Post方法PDF在Spring 3.0控制器中无法下载 你有错误吗?还是空白页?您看到了什么行为?在响应体中获得响应而不是pdf下载。 @RequestMapping(method = RequestMethod.POST, value = "/download/applicationpicker/{formName}", consumes = "application/json", produces = "application/pdf") public void printInitialA

Post方法PDF在Spring 3.0控制器中无法下载
你有错误吗?还是空白页?您看到了什么行为?在响应体中获得响应而不是pdf下载。
@RequestMapping(method = RequestMethod.POST, value = "/download/applicationpicker/{formName}", consumes = "application/json", produces = "application/pdf")
public void printInitialApplicationPDF(HttpServletResponse response, @PathVariable String formName, @RequestBody ArrayList uids) {

    String fileName = formName + ".pdf";
    response.setHeader("Content-disposition", "attachment; filename=" + fileName);
    ServletOutputStream out = null;
    FileInputStream in = null;
    try {
        downloadService.getApplicationPickerData(uids, "initial");
        in = new FileInputStream(ProductConstants.getDataFeedRoot() + ProductConstants.INITIAL_APP_FORM);
        out = response.getOutputStream();
        IOUtils.copy(in, out);
        out.flush();
    } catch (IOException ioe) {
        log.info("Error exporting file " + fileName);
    } finally {
        try {
            out.close();
        } catch (IOException e) {
            log.info("Error Closing ServletOutputStream while wrting file " + fileName);
        }
    }