Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
Is it possible to work with json type in java spring boot?

Is it possible to work with json type as in javascript without generating JSONOject in java spring boot? Is it possible to work with the { } format without creating a JSONObject?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

JSON stands for "JavaScript Object Notation". The Java Syntax does not support JSON. Therefore, we cannot use JSON to declare any object in Java like

MyAwesomeObject object = { "name": "foo", "age": 42 };

We can, however, convert a String that contains a JSON-string into a JSONObject. See this question by dogbane for details.

If we use, for example, jackson, we can convert a String to an object through jackson's ObjectMapper:

final String json = "{ \"name\": \"foo\", \"age\": 42 }";
try {
    MyAwesomeObject object = objectMapper.readValue(json, MyAwesomeObject.class);
} catch (IOException e) {
    ...
}

For more details on jackson, I recommend reading this tutorial from baeldung.com.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda