Announcement Announcement Module
Collapse
No announcement yet.
How do I return multipart/mixed in Spring ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I return multipart/mixed in Spring ?

    I got to migrate from CXF to Spring, how do I return multipart/mixed in Spring




    The below is what I've from CXF


    Code:
    @Override
    	public MultipartBody dumpCustomer(String id) {
    		
    		  List<Attachment> atts = new LinkedList<Attachment>();
    		  
    		  Customer c = new Customer();
    	        c.setName("John");
    	        c.setId(7777);
    	        
    	     atts.add(new Attachment("data", "application/json",c));
    	      try {
    			atts.add(new Attachment("certificate", "application/pdf", new FileInputStream(file)));
    		} catch (FileNotFoundException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    	      return new MultipartBody(atts, true);
Working...
X