I
I
Ildar V2016-12-19 15:39:14
Java
Ildar V, 2016-12-19 15:39:14

How to accept arbitrary json in rest service?

The service must accept data in json format, and parse this data into classes that extend one abstract class. The service must accept any descendants of the parent abstract class.
Which descendant of the class we should accept will be clear only after checking the context.
How can this be implemented.
Java 7

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Severus256, 2016-12-19
@ivaleyev

let the controller in java accept HttpServletRequest or MultipartServletRequest, then parse the necessary data from there in the controller/service

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question