Join Alex Theedom for an in-depth discussion in this video Work with Bean Validation, part of Java EE: RESTful Service with JAX-RS 2.0.
- [Instructor] Okay, let's start by annotating…the book resource entity.…I'm gonna open the book resource,…and scroll down to where we have the fields.…So the first field I'm going to annotate…with the constraint is the ID field.…This should be no longer or shorter than 10 characters.…So we can use the size annotation and specify…a minimum and maximum of 10.…This will ensure that any string longer or shorter…than 10 will result in a constraint violation.…So we start by annotating, using the size annotation.…
And we start by entering in a min value as 10,…and the max value as 10.…And there we have it, we've configured that…our ID cannot be longer or shorter than 10 characters.…Let's move on and have a look at the title field.…Now I want to annotate the title field,…which I want to be at least five characters in length,…so here I set the minimum value.…So I start again, with my size annotation,…and I simply pass in…the min value, which is going to be five.…
And the description, I want to be…at least 20 characters long.…
Join Alex Theedom as he guides you through a wide range of topics, including how to define resource endpoints, how to add dynamism to your application with hypermedia, how to maintain data integrity with Bean Validation, and how to process messages with the JSON Processing API. Once you have completed this course, you'll be ready to develop your own client and server RESTful APIs.
- Discover the extent of JAX-RS's features
- Use the annotation methodology
- Use the inheritance methodology
- Define a REST contract and API root
- Create the REST resource entity
- Create the REST resource methods
- Understand consumers and producers
- Work with different media types
- Define and work with path parameters
- Build a REST response and handle exceptions
- Implement Bean Validation and manage failures
- Create a RESTful client that consumes the web service
- Use JSON-P API with the REST client
- Implement hypermedia (HATEOAS)
Skill Level Intermediate
WebSocket Programming with Java EEwith Alex Theedom1h 29m Intermediate
1. JAX-RS 2.0
2. Introduction to Bookshop Application
3. Create a REST Resource
4. Responses and HATEOAS
5. Bean Validation API
6. Create a REST Client
Next steps1m 20s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.