
Programming RESTful Services with REST/JAX-RS
This course provides in-depth coverage of REST principles and building RESTful services using the JAX-RS 2.0 API. It includes a brief overview of SOAP-based services and WSDL to provide a contrast to RESTful services.
To really understand REST, we need to remind (teach) students about the full capabilities of HTTP, since RESTful service design is centered on the innate principles and capabilities of the HTTP protocol. Stated differently, RESTful services should use HTTP the way it was originally intended, not just as GET/POST plumbing for request/response data. You will emerge from the course with a full understanding of the HTTP protocol and its vision of the “original web,” and how these ideas are implemented in RESTful applications.
We’ll show you how to handle the most common types of request input, culminating in the transmission of HTTP entities in both XML and JSON format, in line with the original intention of HTTP. You’ll also learn how to create appropriate responses given a variety of inputs and conditions, according to the guidelines and principles in the HTTP standard.
On the client side, we look at Ajax-JavaScript clients, as well as standalone Java clients using the JAX-RS 2.0 Client API.
Your daily personal use of the web is increasingly RESTful, and this course will show you how to expose your backend business systems using REST and the innate API and capabilities of HTTP. We also take cues from the masters such as Google, examining some of their public services and using them as a backdrop in building our own.
The course is very hands-on with frequent labs, in which the student can see these ideas implemented in software.
All labs are done with the Eclipse IDE Java EE version and the WildFly Application Server, and the lab instructions include detailed directions for using them. Other IDEs and servers available on request.
- Understand the purpose and role of web services in general, and how they are architected to expose business systems and processes over the web.
- Understand the concepts and principles of REST and HTTP applications.
- Expande your knowledge of HTTP, including its full set of methods and their intended uses, important headers, response codes, and content types.
- Understand REST APIs, including resource identifiers and the URI namespace, resources and subresources, and WADL.
- Understand configuration, deployment, and the runtime environment, including per-request and singleton objects, options for dependency injection, etc.
- Understand how HTTP requests get dispatched to service methods.
- Understand content negotiation and the importance of
Accept
andContent-Type
headers, and how they impact method dispatching. - Learn to bind request inputs to method parameters, including path parameters, query parameters, and headers.
- Learn to exchange business data by communicating in HTTP entities in both XML and JSON format.
- Learn to handle errors using Java exceptions and appropriate HTTP response codes.
- Learn how to integrate JAX-RS services with other Java EE technologies like servlets, EJB, and CDI, and how JAX-RS fits into the larger Java EE landscape.
- Learn to write browser clients using Ajax-JavaScript.
- Learn to write Java clients using the JAX-RS 2.0 Client API, including standalone clients and server-side components invoking remote services.
- Learn how to secure RESTful resources.
Public expert-led online training from the convenience of your home, office or anywhere with an internet connection. Guaranteed to run .
Private classes are delivered for groups at your offices or a location of your choice.
- Java Overview
- Language and Platform Features
- A Simple Java Program
- The Java Release Cycle
- Program Lifecycle
- The Java SE Development Kit (JDK)
- LABS:
- Hello World: A Simple Application
- Class and Object Basics
- The Object Model and Object-Oriented Programming
- Classes, References, and Instantiation
- Adding Data to a Class Definition
- Adding Methods (Behavior)
- LABS:
- Exploring Types and Object Instances
- Introducing your IDE
- Writing and Using a Class Definition with Fields and Methods
- More on Classes and Objects
- More about Methods
- Encapsulation and Access Control, public and private Access
- Constructors and Initialization
- static Members of a Class
- LABS:
- Accessor Methods
- Encapsulation / Access Protection
- Writing and Using Constructors
- Static Members
- Flow of Control
- Branching: if, if-else, switch
- Iteration: while, do-while, for, break, continue
- LABS:
- Data Validation
- More about Classes and Objects
- Type-safe Enums
- Wrapper Classes
- Java 8+ Date/Time Support
- Working with References
- Formatted Output
- LABS:
- Using enums
- Working with Dates and Times
- Using the Debugger
- Strings, Arrays, and Dates/Times
- String, StringBuffer, StringBuilder
- Arrays, Primitive Arrays, Arrays of Reference Types
- varargs
- LABS:
- Using Strings and Arrays
- Packages and Modules
- Package Overview - Using Packages to Organize Code
- Creating Packages, package Statement, Required Directory Structure
- import statements
- Classpath
- Java Modules Overview
- Defining Modules, Requires, and Exports
- Module Path and Classpath - Differences and Coexistence
- LABS:
- Using Packages
- Using Java Modules
- Composition and Inheritance
- Using Composition to Deal With Complexity
- Composition/HAS-A, Delegation
- Using Inheritance to share commonality
- IS-A, extends Inheriting Features
- Constructor Issues
- Overriding Methods, @Override, Using Polymorphism
- Abstract Classes
- LABS:
- Working with Composition
- Using Inheritance
- Polymorphism
- Polymorphism
- Interfaces
- Defining and Implementing Interfaces
- Using Interfaces
- Default Methods and static Methods
- LABS:
- Using Interfaces to Remove Implementation Dependencies
- Using Default and Static Methods
- Exceptions
- Exceptions and the Exception Hierarchy
- Throwing Exceptions and Checked Exceptions
- try and catch
- Handling Exceptions
- try and catch
- Program Flow with Exceptions
- Multicatch, finally, try-with-resources
- LABS:
- Throwing Exceptions
- Checked Exceptions
- Java Collections and Generics
- The Collections Framework and its API
- Collections and Java Generics
- Collection, List, Set, Map
- Autoboxing
- Collections of Object (non-generic)
- Using ArrayList, HashSet, and HashMap
- for-each Loop
- Processing Items With an Iterator
- More About Generics
- LABS:
- Using Collections and Generics
- Database Access with JDBC and JPA
- JDBC Overview
- JDBC Defined Types
- Example of JBDC Usage
- JPA Overview
- JPA Architecture and Programming View
- Mapping Entity Classes with Annotations
- Persistence Unit, EntityManagerFactory, and EntityManager
- Working with JPA (Find by primary key and inserts)
- LABS:
- Mapping an Entity Class
- Using JPA
- Insert/Query Demo
- I/O Streams (Optional)
- I/O Streams Overview
- Readers and Writers
- Exception Handling
- Byte Streams
- Working with Files
- NIO, Paths, Files
- LABS:
- Reading and Writing Files
- Using Byte Streams (Optional)
- Additional Language Features (Optional)
- Functional Interfaces and Lambda Expressions
- Switch Expressions
- Other Java Features
- LABS:
- Working with Lambdas (Demo)
Each student will receive a comprehensive set of materials, including course notes and all the class examples.
Experience in the following is required for this Java class:
- Attendees must be experienced in Java and ideally will be somewhat familiar with XML, Java web applications, and other Java EE standards.
Experience in the following would be useful for this Java class:
- Familiarity with Ajax, JavaScript, and JSON.
Courses that can help you meet these prerequisites:
Register for a Live Class
Request a Private Class
- Private Class for your Team
- Online or On-location
- Customizable
- Expert Instructors