File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -371,3 +371,46 @@ fun main(args: Array<String>) {
371371----
372372
373373{love}
374+
375+ === JAX-RS Annotations
376+
377+ Alternative you can use JAX-RS annotations to define MVC routes.
378+
379+ .Resource
380+ [source, java, role="primary"]
381+ ----
382+
383+ import javax.ws.rs.GET;
384+ import javax.ws.rs.Path;
385+
386+ @Path("/jaxrs")
387+ public class Resource {
388+
389+ @GET
390+ public String getIt() {
391+ return "Got it!";
392+ }
393+ }
394+ ----
395+
396+ .Kotlin
397+ [source, kotlin, role="secondary"]
398+ ----
399+ import javax.ws.rs.GET
400+ import javax.ws.rs.Path
401+
402+ @Path("/jaxrs")
403+ class Resource {
404+
405+ @GET
406+ fun getIt() : String {
407+ return "Got it!"
408+ }
409+ }
410+ ----
411+
412+ Annotations work exactly like the Jooby MVC annotations, but keep in mind we don't implement the
413+ JAX-RS specification and there is no immediate plan to do it.
414+
415+ The main reason to support JAX-RS annotations is to let you plug-in third-party tools that rely
416+ on them (mostly annotations processors).
You can’t perform that action at this time.
0 commit comments