Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
jvx:communication:rest_customservice [2022/11/18 09:06]
admin
jvx:communication:rest_customservice [2022/11/22 10:06] (current)
admin
Line 1: Line 1:
 ~~NOTRANS~~ ~~NOTRANS~~
 ~~Title: Custom REST service registration~~ ~~Title: Custom REST service registration~~
 +
 JVx already has [[jvx:​common:​util:​rest|REST services]] for action calls, data access an administration. Sometimes it's necessary to offer custom REST services for an application. Sure, you could create a simple action in your application and an action can be called with standard REST services, but this requires application authentication. If you have a different use-case for your REST service it's also possible to create your own REST service without using different libraries. JVx already has [[jvx:​common:​util:​rest|REST services]] for action calls, data access an administration. Sometimes it's necessary to offer custom REST services for an application. Sure, you could create a simple action in your application and an action can be called with standard REST services, but this requires application authentication. If you have a different use-case for your REST service it's also possible to create your own REST service without using different libraries.
  
-The easiest solution is to create a service class which is a servlet context listener. Why a listener? because we need an entry point to register our custom service. If you don't prefer a listener, it would also be possible to create a server plugin for JVx' server. But in this article, we use a servlet context listener.+The easiest solution is to create a service class which is a servlet context listener. Why a listener? because we need an entry point to register our custom service. If you don't prefer a listener, it would also be possible to create a [[jvx:​common:​setup:​plugins|server plugin]] for JVx' server. But in this article, we use a servlet context listener.
  
 Our class looks like: Our class looks like:
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information