当前位置: 首页>>代码示例>>Java>>正文


Java MultipartHttpServletRequest.getParameter方法代码示例

本文整理汇总了Java中org.springframework.web.multipart.MultipartHttpServletRequest.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java MultipartHttpServletRequest.getParameter方法的具体用法?Java MultipartHttpServletRequest.getParameter怎么用?Java MultipartHttpServletRequest.getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.web.multipart.MultipartHttpServletRequest的用法示例。


在下文中一共展示了MultipartHttpServletRequest.getParameter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateIndexImg

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
public void updateIndexImg(MultipartHttpServletRequest multipartReq, MarketApp marketApp) throws IOException,
        MalformedURLException, URISyntaxException {
    int id = marketApp.getId();

    // 大游戏首页图片.浏览器上传用户本地文件 或 下载远端服务器 图片.
    String indexImgUrlBak = multipartReq.getParameter("oldIndexImgUrl"); // app.getIndexImgUrl();
    boolean needToDeleteIndexImgUrlBak = false;
    String remoteIndexImgUrl = multipartReq.getParameter("remoteIndexImgUrl");
    MultipartFile file = multipartReq.getFile("indexImgFile");
    String subPath = null;
    if (file != null && !file.isEmpty()) {
        subPath = attachmentService.saveMarketAppFile(id, file);
    } else if (StringUtils.isNotBlank(remoteIndexImgUrl)) {
        // 拉取图片.
        subPath = attachmentService.saveMarketAppFile(id, remoteIndexImgUrl);
    }
    if (StringUtils.isNotBlank(subPath)) {
        String indexImgUrl = PathUtils.concate(appConfig.getDestBigGameUploadBaseurl(), subPath);
        marketApp.setIndexImgUrl(indexImgUrl);
        saveOrUpdate(marketApp);
        needToDeleteIndexImgUrlBak = true;
    }
    if (appConfig.isDeleteUploadImageFile() && StringUtils.isNotBlank(indexImgUrlBak) && needToDeleteIndexImgUrlBak) {
        attachmentService.deleteFile(indexImgUrlBak);
    }
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:27,代码来源:MarketAppServiceImpl.java

示例2: updateLogo

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
public void updateLogo(MultipartHttpServletRequest multipartReq, MarketApp marketApp) throws IOException,
        MalformedURLException, URISyntaxException {
    int id = marketApp.getId();
    // logo. 浏览器上传用户本地文件 或 下载远端服务器 图片.
    String logoUrlBak = multipartReq.getParameter("oldLogoUrl");// app.getLogoUrl();
    boolean needToDeleteLogoUrlBak = false;
    String remoteLogoUrl = multipartReq.getParameter("remoteLogoUrl");
    MultipartFile file = multipartReq.getFile("logoFile");
    String logoSubPath = null;
    if (file != null && !file.isEmpty()) {
        logoSubPath = attachmentService.saveMarketAppFile(id, file);
    } else if (StringUtils.isNotBlank(remoteLogoUrl)) {
        // 拉取图片.
        logoSubPath = attachmentService.saveMarketAppFile(id, remoteLogoUrl);
    }
    if (StringUtils.isNotBlank(logoSubPath)) {
        String logoUrl = PathUtils.concate(appConfig.getDestBigGameUploadBaseurl(), logoSubPath);
        marketApp.setLogoUrl(logoUrl);
        saveOrUpdate(marketApp);
        needToDeleteLogoUrlBak = true;
    }
    if (appConfig.isDeleteUploadImageFile() && StringUtils.isNotBlank(logoUrlBak) && needToDeleteLogoUrlBak) {
        attachmentService.deleteFile(logoUrlBak);
    }
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:26,代码来源:MarketAppServiceImpl.java

示例3: updateIndexImg

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
public void updateIndexImg(MultipartHttpServletRequest multipartReq, App app) throws IOException,
        MalformedURLException, URISyntaxException {
    int id = app.getId();

    // 大游戏首页图片.浏览器上传用户本地文件 或 下载远端服务器 图片.
    String indexImgUrlBak = multipartReq.getParameter("oldIndexImgUrl"); // app.getIndexImgUrl();
    boolean needToDeleteIndexImgUrlBak = false;
    String remoteIndexImgUrl = multipartReq.getParameter("remoteIndexImgUrl");
    MultipartFile file = multipartReq.getFile("indexImgFile");
    String subPath = null;
    if (file != null && !file.isEmpty()) {
        subPath = attachmentService.saveFile(id, file);
    } else if (StringUtils.isNotBlank(remoteIndexImgUrl)) {
        // 拉取图片.
        subPath = attachmentService.saveFile(id, remoteIndexImgUrl);
    }
    if (StringUtils.isNotBlank(subPath)) {
        String indexImgUrl = PathUtils.concate(appConfig.getDestUploadBaseurl(), subPath);
        app.setIndexImgUrl(indexImgUrl);
        saveOrUpdate(app);
        needToDeleteIndexImgUrlBak = true;
    }
    if (StringUtils.isNotBlank(indexImgUrlBak) && needToDeleteIndexImgUrlBak) {
        attachmentService.deleteFile(indexImgUrlBak);
    }
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:27,代码来源:AppServiceImpl.java

示例4: upload

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public @ResponseBody JSONResponseBody upload(MultipartHttpServletRequest request) {
  try {
    String position = request.getParameter("position");

    MultipartFile attachment = request.getFile("file");
    if (attachment != null && attachment.getSize() > 0) {
      FileMeta meta = new FileMeta();
      meta.setId(request.getParameter("productId"));
      meta.setName(IdUtils.uuid2());
      meta.setSize(attachment.getSize());
      meta.setExtension(StringUtils.getFilenameExtension(attachment.getOriginalFilename()));
      meta.setBytes(attachment.getBytes());
      meta.setUrl(Constants.DEPLOY_URL + Constants.PRODUCT_IMG_UPLOAD_DIR);

      return new JSONResponseBody(productService.uploadImgBlock(meta, position));
    }
  } catch (Exception e) {
    log.error(ExceptionUtils.getStackTraceAsString(e));

    return new JSONResponseBody(false, e.getMessage());
  }

  return new JSONResponseBody();
}
 
开发者ID:nickevin,项目名称:Qihua,代码行数:26,代码来源:ProductImgBlockController.java

示例5: uploadCenter

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
@RequestMapping(value = "/img/upload", method = RequestMethod.POST)
public @ResponseBody JSONResponseBody uploadCenter(MultipartHttpServletRequest request) {
  try {
    String position = request.getParameter("position");

    MultipartFile attachment = request.getFile("file");
    if (attachment != null && attachment.getSize() > 0) {
      FileMeta meta = new FileMeta();
      meta.setId(request.getParameter("productId"));
      meta.setName(IdUtils.uuid2());
      meta.setSize(attachment.getSize());
      meta.setExtension(StringUtils.getFilenameExtension(attachment.getOriginalFilename()));
      meta.setBytes(attachment.getBytes());
      meta.setUrl(Constants.DEPLOY_URL + Constants.PRODUCT_IMG_UPLOAD_DIR);

      return new JSONResponseBody(homeService.uploadImg(meta, position));
    }
  } catch (Exception e) {
    log.error(ExceptionUtils.getStackTraceAsString(e));

    return new JSONResponseBody(false, e.getMessage());
  }

  return new JSONResponseBody();
}
 
开发者ID:nickevin,项目名称:Qihua,代码行数:26,代码来源:HomeController.java

示例6: updateLogo

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
public void updateLogo(MultipartHttpServletRequest multipartReq, App app) throws IOException,
        MalformedURLException, URISyntaxException {
    int id = app.getId();
    // logo. 浏览器上传用户本地文件 或 下载远端服务器 图片.
    String logoUrlBak = multipartReq.getParameter("oldLogoUrl");// app.getLogoUrl();
    boolean needToDeleteLogoUrlBak = false;
    String remoteLogoUrl = multipartReq.getParameter("remoteLogoUrl");
    MultipartFile file = multipartReq.getFile("logoFile");
    String logoSubPath = null;
    if (file != null && !file.isEmpty()) {
        logoSubPath = attachmentService.saveFile(id, file);
    } else if (StringUtils.isNotBlank(remoteLogoUrl)) {
        // 拉取图片.
        logoSubPath = attachmentService.saveFile(id, remoteLogoUrl);
    }
    if (StringUtils.isNotBlank(logoSubPath)) {
        String logoUrl = PathUtils.concate(appConfig.getDestUploadBaseurl(), logoSubPath);
        app.setLogoUrl(logoUrl);
        saveOrUpdate(app);
        needToDeleteLogoUrlBak = true;
    }
    if (StringUtils.isNotBlank(logoUrlBak) && needToDeleteLogoUrlBak) {
        attachmentService.deleteFile(logoUrlBak);
    }

    appHistory4IndexDao.saveOrUpdate(app.getId());
}
 
开发者ID:zhaoxi1988,项目名称:sjk,代码行数:28,代码来源:AppServiceImpl.java

示例7: insertRequestOffer

import org.springframework.web.multipart.MultipartHttpServletRequest; //导入方法依赖的package包/类
/**
 * 지식정보제공/지식정보요청를 등록 처리 한다.
 * 
 * @param requestOfferVO
 */
@RequestMapping(value = "/dam/spe/req/insertRequestOffer.do")
public String insertRequestOffer(
		MultipartHttpServletRequest multiRequest, 
		@ModelAttribute RequestOfferVO requestOfferVO, 
		BindingResult bindingResult, 
		ModelMap model) 
throws Exception {

	// 서버 validate 체크
	beanValidator.validate(requestOfferVO, bindingResult);
	if (bindingResult.hasErrors()) {
		return WebUtil.adjustViewName("/dam/spe/req/RequestOfferRegist");
	}

	// 첨부파일 관련 첨부파일ID 생성
	requestOfferVO.setAtchFileId(fileUtil.insertMultiFile(multiRequest, "DSCH_"));

	// 로그인 객체 선언
	LoginVO loginVO = (LoginVO) UserDetailsHelper.getAuthenticatedUser();
	requestOfferVO.setFrstRegisterId(loginVO.getUniqId());

	// 지식전문가 일때
	String sCmd = multiRequest.getParameter("cmd") == null ? "" : multiRequest.getParameter("cmd");
	if (sCmd.equals("reply") ) {
		if( requestOfferService.selectRequestOfferSpeCheck(loginVO.getUniqId())) {
			requestOfferVO.setSpeId(loginVO.getUniqId());
			requestOfferService.replyRequestOffer(requestOfferVO);
		} else {
			return WebUtil.adjustViewName("/dam/spe/req/RequestOfferRegist");
		}
	} else {
		requestOfferVO.setEmplyrId(loginVO.getUniqId());
		requestOfferService.insertRequestOffer(requestOfferVO);
	}
	
	model.addAttribute("message", MessageHelper.getMessage("success.common.insert"));
	return WebUtil.redirectJsp(model, "/dam/spe/req/listRequestOffer.do");
}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:44,代码来源:RequestOfferController.java


注:本文中的org.springframework.web.multipart.MultipartHttpServletRequest.getParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。