Support both XML and JSON in a Spring API (RWS - Module 2 - Lesson 5)

preview_player
Показать описание
Learn how to implement Content Negotiation in the API with Spring and how to support both JSON and XML.

This lesson is part of "REST With Spring" - Module 2 (REST and HTTP Semantics) - Lesson 5:

## Lesson Notes

# The Maven Dependencies
- jackson-dataformat-xml
- woodstox-core-asl

# Advantages of using Jackson for XML
Using the new Jackson Spring support for XML has quite a few advantages over using another XML library (such as XStream):
- we're already using Jackson for JSON
- we can re-use the exact same configuration that we're already using for JSON
- no need to add extra annotations to the DTOs
- JSON Views support

# Why change the default STAX implementation
Woodstox has a few advantages over the default STAX impl in the JDK:
- it's faster
- has extra features
- it's more mature and well maintained

To learn more about REST and how to properly implement these HTTP semantics, check out the full course:

Enjoy.
Рекомендации по теме
Комментарии
Автор

great tutorial please add spring jpa transaction video!

javafordeveloper
Автор

Great and useful tutorial for Spring noobs (Y)

ruixue
Автор

mm...the text is blurry which makes it nest to impossible to read.

ooostephen