Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Jersey BodyPartEntity issue
Jersey BodyPartEntity issue [message #1852069] Thu, 28 April 2022 10:28 Go to next message
Elias Ilyin is currently offline Elias IlyinFriend
Messages: 1
Registered: April 2022
Junior Member
why I cant get BodyPartEntity ?

String actual = multiPart.getBodyParts().get(0).getEntityAs(String.class);
or
BodyPartEntity actual = multiPart.getBodyParts().get(0).getEntityAs(BodyPartEntity.class);
catch - BodyPartEntity actual = multiPart.getBodyParts().get(0).getEntityAs(BodyPartEntity.class);

BodyPartEntity actual = (BodyPartEntity) multiPart.getBodyParts().get(0).getEntity();
catch - ClassCastException: java.lang.String cannot be cast to org.glassfish.jersey.media.multipart.BodyPartEntity

my multipart:
FormDataMultiPart multiPart = new FormDataMultiPart();
multiPart.bodyPart(new FormDataBodyPart("meta", "{\"field1\":\"answer1\",\"field2\":\"answer2\"}", MediaType.APPLICATION_JSON_TYPE));
multiPart.bodyPart(new FormDataBodyPart("cont", doc, new MediaType("image", MediaType.MEDIA_TYPE_WILDCARD)));

Jersey 3/0/4
Re: Jersey BodyPartEntity issue [message #1852089 is a reply to message #1852069] Thu, 28 April 2022 16:11 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 32506
Registered: July 2009
Senior Member
Maybe ask here where this project expects users to go for asking questions:

https://projects.eclipse.org/projects/ee4j.jersey/contact


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Colors resets on startup!
Next Topic:Nebula NatTable Integer column Sorting
Goto Forum:
  


Current Time: Thu Oct 06 04:31:41 GMT 2022

Powered by FUDForum. Page generated in 0.03279 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top