Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 18. Web services configuration in JBoss EAP
JBoss EAP enables you to configure the behavior of deployed web services through the webservices subsystem by using the management console or management CLI. This configuration applies to Jakarta Web Services (JAX-WS) endpoints and allows you to set up published endpoint addresses, handler chains, and runtime statistics collection for web services.
18.1. JSON merge patch Link kopierenLink in die Zwischenablage kopiert!
You can use the JSON merge patch feature to change the target resource. This feature allows you to change the target resource without providing the full modified resource. The client sends the JSON change directly to the server resource where it is merged to the target resource. The requested Uniform Resource Identifier (URI) is used to identify the target resource.
PATCH /StudentPatchTest/students/1 HTTP/1.1
Content-Type: application/merge-patch+json
Content-Length: 34
Host: localhost:8090
Connection: Keep-Alive
{"firstName":"Green","school":null}
The JSON merge patch feature is enabled by default. To use this feature, annotate the resource method with @Consumes("application/merge-patch+json"). For more information about the JSON merge patch feature, see JSON Patch and JSON Merge Patch in the RESTEasy user guide.
The configuration switch, resteasy.patchfilter.disabled, is set to false by default. For more information about this switch, see Configuration switches in the RESTEasy user guide.
@GET
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Student getStudent(@PathParam("id") long id) {
Student student = studentsMap.get(id);
if (student == null) {
throw new NotFoundException();
}
return student;
}
@PATCH
@Path("/{id}")
@Consumes("application/merge-patch+json")
@Produces(MediaType.APPLICATION_JSON)
public Student mergePatchStudent(@PathParam("id") long id, Student student)
{
if (studentsMap.get(id) == null)
{
throw new NotFoundException();
}
studentsMap.put(id, student);
return student;
}