close

Filter

loading table of contents...

Release Notes / Version 10.2107

Table Of Contents

Studio REST Service now runs on Spring MVC Instead of Jersey

As part of our efforts for supporting Java 11, the Studio REST service now runs on Spring MVC instead of Jersey 1 (JAX-RS). Jersey dependencies are now banned throughout the workspace to avoid any mixture.

While the Studio REST framework itself received a major overhaul, the effect for Studio backend developers is not as big. Migrating your Jersey-based code to Spring-MVC-based code is mostly straightforward. There are multiple 'cheat sheets' around of how to replace your Jersey /JAX-RS keywords by Spring MVC keywords. Some of the more important ones are listed in the following:

Spring MVC => JAX-RS
@RequestMapping(path = “/myresource” => @Path(“/myresource”)
@PostMapping => @POST
@PutMapping	 => @PUT
@GetMapping	 => @GET
@DeleteMapping => @DELETE
@ResponseBody => N/A (not necessary)
@RequestBody => N/A (not necessary)
@PathVariable(“id”) => @PathParam(“id”)
@RequestParam(“xyz”) => @QueryParam(‘xyz”)
@RequestParam(value=”xyz”) => @FormParam(“xyz”)
@RequestMapping(produces = ...)	=> @Produces(...) 
@RequestMapping(consumes = ...) => @Consumes(...) 

One major change concerns REST resources implementing 'EntityResource' (although it is not public API we know that the interface is in use in customer blueprint extensions). Previously, the interface assumed that implementing resources where of scope 'prototype'. Now the default scope is assumed. As a result, implementing resources must not hold any state such as IDs but serve requests in a state-less fashion. Changes to the interface reflect this new assumption as request parameters now need to be passed as method parameters instead of being stored in class variables.

(CMS-12077)

Search Results

Table Of Contents