Spark
Very simple to use
public static void main(String...args) {
get("/umPath", (req, res) -> {
//Regra de negocio
return "resultado"
});
}
Springboot
Also very simple, but unlike Spark, a controller should be created and annotated with @Restcontroller
@ResController
@EnableAutoConfiguration
public class UmaClasseController {
@RequestMapping("/umPath")
@ResponseBody
String ola() {
//Regra de negocio
return "Resultado";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(UmaClasseController.class, args);
}
}
The good thing about Spring is that if you put the return type as an object or an object collection it already serializes to JSON.
Jersey
It’s also good, but requires some settings, and can be used along with Springboot, annotated with @Component.
However I also found -> Java Restful Plugin for Eclipse
– Pedro Simões
I really like Jersey, already took a look at it?
– Wellington Avelino