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);
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

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: 32653
Registered: July 2009
Senior Member
Maybe ask here where this project expects users to go for asking questions:

Ed Merks
Professional Support:
Previous Topic:Colors resets on startup!
Next Topic:Nebula NatTable Integer column Sorting
Goto Forum:

Current Time: Fri Jan 27 12:36:15 GMT 2023

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

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

Back to the top