Index: web-module/src/main/java/egovframework/api/arms/module_pdservice/controller/UserPdServiceController.java =================================================================== diff -u -r56c3311d9585c75c1f6de902e7a6dd893bf698ee -rd1e1d0cfc526020e00f75a75ab7548a419f6ee05 --- web-module/src/main/java/egovframework/api/arms/module_pdservice/controller/UserPdServiceController.java (.../UserPdServiceController.java) (revision 56c3311d9585c75c1f6de902e7a6dd893bf698ee) +++ web-module/src/main/java/egovframework/api/arms/module_pdservice/controller/UserPdServiceController.java (.../UserPdServiceController.java) (revision d1e1d0cfc526020e00f75a75ab7548a419f6ee05) @@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRequest; import java.lang.reflect.Field; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.NoSuchElementException; @@ -99,13 +100,14 @@ /** * 이미지 Upload를 처리한다. * - * @param request + * @param multiRequest * @param model * @return * @throws Exception */ + @ResponseBody @RequestMapping(value="/uploadFileToNode.do") - public String uploadFileToNode(final MultipartHttpServletRequest multiRequest, Model model) throws Exception { + public ModelAndView uploadFileToNode(final MultipartHttpServletRequest multiRequest, Model model) throws Exception { // Spring multipartResolver 미사용 시 (commons-fileupload 활용) //List list = EgovFormBasedFileUtil.uploadFiles(request, uploadDir, maxFileSize); @@ -117,17 +119,21 @@ if (list.size() > 0) { EgovFormBasedFileVo vo = list.get(0); // 첫번째 이미지 - String url = multiRequest.getContextPath() - + "/utl/web/imageSrc.do?" - + "path=" + vo.getServerSubPath() - + "&physical=" + vo.getPhysicalName() - + "&contentType=" + vo.getContentType(); +// String url = multiRequest.getContextPath() +// + "/utl/web/imageSrc.do?" +// + "path=" + vo.getServerSubPath() +// + "&physical=" + vo.getPhysicalName() +// + "&contentType=" + vo.getContentType(); //model.addAttribute("CKEditorFuncNum", request.getParameter("CKEditorFuncNum")); - model.addAttribute("url", url); + //model.addAttribute("url", url); } + HashMap> map = new HashMap>(); + map.put("files", list); + ModelAndView modelAndView = new ModelAndView("jsonView"); + modelAndView.addObject("result", map); - return "egovframework/com/utl/wed/EgovInsertImage"; + return modelAndView; } @RequestMapping(value="/updateContentsToNode.do", method=RequestMethod.POST)