Package org.springframework.web.multipart.support

Examples of org.springframework.web.multipart.support.ByteArrayMultipartFileEditor


 
  /* (non-Javadoc)
   * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)
   */
  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
 
View Full Code Here


 
  /* (non-Javadoc)
   * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)
   */
  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
  }
View Full Code Here

  }

  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(byte[].class,
        new ByteArrayMultipartFileEditor());
  }
View Full Code Here

  }

  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(byte[].class,
        new ByteArrayMultipartFileEditor());
  }
View Full Code Here

  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder)
  throws ServletException {
    SystemUtils.print("initBinder");
    // to actually be able to convert Multipart instance to byte[]
    // we have to register a custom editor
    binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
    binder.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, DecimalFormat.getInstance(RequestContextUtils.getLocale(request)),true));
    binder.registerCustomEditor(GregorianCalendar.class,new GregorianCalendarPropertyEditor());
    binder.registerCustomEditor( Double.class, new CustomNumberEditor(Double.class, DecimalFormat.getInstance(RequestContextUtils.getLocale(request)),true));
//    binder.registerCustomEditor(File.class, new FileEditor());
//    binder.registerCustomEditor( Float.class, new CustomNumberEditor(Float.class, DecimalFormat.getInstance(RequestContextUtils.getLocale(request)),true));
View Full Code Here

    }
   
    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws ServletException {
        // to actually be able to convert Multipart instance to byte[]
        // we have to register a custom editor
        binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
        // now Spring knows how to handle multipart object and convert them
    }
View Full Code Here

    }

    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws ServletException {
        // to actually be able to convert Multipart instance to byte[]
        // we have to register a custom editor
        binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
        // now Spring knows how to handle multipart object and convert them
    }
View Full Code Here

    }

    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws ServletException {
        // to actually be able to convert Multipart instance to byte[]
        // we have to register a custom editor
        binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
        // now Spring knows how to handle multipart object and convert them
    }
View Full Code Here

  private ContactRepository contactRepository;
 
  @InitBinder
  protected void initBinder(ServletRequest request, ServletRequestDataBinder binder) throws Exception {
      // to actually be able to convert Multipart instance to byte[] we have to register a custom editor
      binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
      // now Spring knows how to handle multipart object and convert
     
      DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
      CustomDateEditor editor = new CustomDateEditor(df, true);
      binder.registerCustomEditor(Date.class, editor);
View Full Code Here

    MultipartTestBean1 mtb1 = new MultipartTestBean1();
    assertArrayEquals(null, mtb1.getField1());
    assertEquals(null, mtb1.getField2());
    ServletRequestDataBinder binder = new ServletRequestDataBinder(mtb1, "mybean");
    binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
    binder.bind(request);
    List<MultipartFile> file1List = request.getFiles("field1");
    CommonsMultipartFile file1a = (CommonsMultipartFile) file1List.get(0);
    CommonsMultipartFile file1b = (CommonsMultipartFile) file1List.get(1);
    CommonsMultipartFile file2 = (CommonsMultipartFile) request.getFile("field2");
View Full Code Here

TOP

Related Classes of org.springframework.web.multipart.support.ByteArrayMultipartFileEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.