-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4312 - Fix BeanParam annotation with body content
- Loading branch information
Showing
3 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,19 +41,35 @@ | |
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
@Path("/beanParam") | ||
@Path("beanParam") | ||
public class BeanParamBean { | ||
|
||
/** | ||
* Process BeanParam annotated input. | ||
* Process BeanParam annotated input without content body. | ||
* | ||
* @param input the input. | ||
* @return the response. | ||
*/ | ||
@POST | ||
@POST | ||
@Path("withoutContent") | ||
@Consumes(APPLICATION_FORM_URLENCODED) | ||
@Produces(TEXT_PLAIN) | ||
public Response beanParamInput(@BeanParam BeanParamInput input) { | ||
return Response.ok(input.toString()).build(); | ||
} | ||
|
||
/** | ||
* Process BeanParam annotated input with content body. | ||
* | ||
* @param content the content body. | ||
* @param input the input. | ||
* @return the response. | ||
*/ | ||
@POST | ||
@Path("withContent") | ||
@Consumes(APPLICATION_FORM_URLENCODED) | ||
@Produces(TEXT_PLAIN) | ||
public Response beanParamInputWithContent(String content, @BeanParam BeanParamInput input) { | ||
return Response.ok(content + "," + input.toString()).build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters