Thursday Feb 26, 2015
Thursday Jan 29, 2015
By David Delabassee-Oracle on Jan 29, 2015
Tuesday Jan 13, 2015
By David Delabassee-Oracle on Jan 13, 2015
Thursday Nov 06, 2014
By David Delabassee-Oracle on Nov 06, 2014
JAX-RS is a key technology of the Java EE platform as REST endpoints are more and more used. Marek Potočiar (JAX-RS Co-Specification Lead) did a session during JavaOne to detail some of the proposed JAX-RS enhancements and extensions that should be part of Java EE 8. These proposals include better support for JSON (JSON-B), improved alignment between JAX-RS and CDI, enhanced support for hypermedia as well as declarative security, server-sent events, and MVC integration.
Jersey is the open source JAX-RS Reference Implementation but Jersey doesn't limit itself to the specification, i.e. Jersey has also has additional specific features. In some cases, some of the Jersey proprietary features have been standardised and added to the specification (eg. the Client API have been added to JAX-RS 2.0). So it is always interesting to check the Jersey specific extensions as some of those might be potential candidates for inclusion into a future revision of the JAX-RS specification. For example, SSE is currently supported in a Jersey specific manner but the plan is to standardised SSE support in JAX-RS 2.1. So make sure to also watch this 'What's New and Noteworthy in Jersey 2' replay that was presented by Jakub Podlešák and Miroslav Fuksa during JavaOne 2014.
You can get the 'Let’s Talk JAX-RS.next!' slides here.
Friday Sep 12, 2014
By David Delabassee-Oracle on Sep 12, 2014
A proposal for JAX-RS 2.1 has been recently submitted to the JCP, this news was a bit overshadowed by the Java EE 8 Platform submission announcement but it is also important. It is important as JAX-RS is a significant technology of the the Java EE Platform but JAX-RS is also very relevant outside of the platform. It is not uncommon to see more specific RESTful based applications built upon a standalone JAX-RS implementation. And with the Client API introduced in JAX-RS 2.0, JAX-RS is also getting more and more relevant in the client space.
JAX-RS 2.1 (JSR 370) has now entered the JSR Review Ballot for a 2 weeks period (ends on September 22). The proposed scope of JAX-RS 2.1 currently includes :
- Adding support for Server-Sent Events
- Improving integration with CDI
- Exploring support for non-blocking I/O in providers (filters, interceptors, etc.)
- Evaluating ways in which declarative security can be supported
- Providing integration with JSON-B
- Making JAXB conditional on runtimes where it is available
- Building upon the hypermedia API introduced in version 2.0
- Investigating the reactive programming paradigm as a way to improve the JAX-RS asynchronous client API
- Evaluating any requirements necessary to support the use of JAX-RS resource classes as controllers in the MVC 1.0 JSR
Even tough JAX-RS 2.1 will be a 'minor' release; its current scope is quite large in terms of added features!
And if you are attending JavaOne, here are a few JAX-RS related sessions that you should consider attending :
- Let’s Talk JAX-RS.next! [CON3864]
- The Future of MVC in JAX-RS [CON3353]
- Java API for JSON Binding: Introduction and Update [CON5307]
- JSON Pointer and JSON Patch: Updates to the Java API for JSON Processing [CON5742]
- RESTful Microservices [CON3786]
- New and Noteworthy in Jersey 2 [CON3782]
- Securing JAX-RS Services with OAuth 2 [CON3774]
- Java EE 8 [CON3015]
- Meet the Java EE Specification Leads [BOF3031]
Tuesday Jun 17, 2014
By David Delabassee-Oracle on Jun 17, 2014
"The biggest guru-mantra is: never share your secrets with anybody. It will destroy you." (Chanakya)
You have probably already heard of OAuth as it is widely used by many online services providers such as Google, FaceBook, LinkedIn, Yahoo, Twitter, ... to name just a few! OAuth is an authentication protocol that allows users to approve application to act on their behalf without sharing their password.
OAuth support was introduced, several years ago, in Jersey 1.x. 'Recently' ... well more than 6 months ago (*), OAuth support has been added to Jersey 2.x, this post post covers in more details the OAuth support added to Jersey 2.3.
If you are not yet familiar with OAuth, it is probably a good time to start to look at this open protocol. The OAuth chapter of the Jersey documentation should be a good starting point.
(*) It's sometime difficult to keep up with the Jersey release cadence! At the time of writing, the current release is Jersey 2.9!
Wednesday Apr 16, 2014
By David Delabassee-Oracle on Apr 16, 2014
A question I sometime get when I talk about JSON-P support in Java EE is what about Schema? The works around JSON Schema standardisation is progressing but right now, this is still a draft specification. Nevertheless, this is something that you can already start to use. For example, this post shows how-to generate JSON Schema with Eclipse Link MOXy today.
Friday Jan 31, 2014
By reza_rahman on Jan 31, 2014
As you probably know, JAX-RS 2/Java EE 7 now includes a brand new standard client API. If you don't know about it yet, you should check out this excellent blog entry by Mohamed Sanaulla now :-). The standard client API uses the factory/builder patterns and not injection. This makes it very well suited for Java SE based environments such as JUnit tests and JavaFX UIs. However Jersey, the JAX-RS 2 reference implemention included in GlassFish 4 goes much further by providing a managed JAX-RS client that makes full use of injection. This is ideal for server-side mash-ups and system-to-system/machine-to-machine communication.
Michal Gajdos of the Jersey team does an excellent job of explaining the API details in this code-driven blog entry. You can also check out the code on GitHub and running example on Heroku!
Tuesday Jan 28, 2014
By David Delabassee-Oracle on Jan 28, 2014
The Java EE specification is an umbrella specification that refers to different components specifications, aka components JSRs (e.g. Servlet, JMS, JAX-RS, ...). And as the Java EE 7 Reference Implementation, GlassFish 4 is made of those different components JSRs Reference Implementations.
So what to do if you want to use one of the new features provided by one of those implementations in GlassFish 4? One way is to wait that the specific version of that implementation, say Jersey for example, is integrated in a nightly build of the GF 4.0.1 branch. Another solution is to upgrade the specific implementation (e.g. Jersey) in an existing GlassFish 4 setup. The following posts explains how to update Tyrus, how to update Jersey, how to update Weld and how to update Mojarra in a GF4 setup.
|It should be mentioned that no extra testing has been done, so clearly do not do this in any critical environments. And if the updated setup is not stable, it is always easy to come back to the initial configuration. Most of the time, it's just a matter of putting back the original implementation Jar and restarting GlassFish. For Jersey, the provided update script is able to restore the initial configuration if needed.|
In any cases, if you are using GF 4 with an updated version of Tyrus, Jersey, Mojarra or Weld, we would like to hear your feedback!
Friday Dec 20, 2013
By reza_rahman on Dec 20, 2013
As you know, HTTP is a stateless protocol. For most use cases in the enterprise, the statelessness of HTTP is a huge boon for scalability - a benefit that is also extended to REST. However, there is a certain class of arguably emerging use cases for which the stateless nature of HTTP is actually a scalability challenge. These use cases require the bidirectional, full-duplex, asynchronous characteristics of stateful protocols such as TCP. Examples include chat-like online collaboration, stock-ticker like command-control/monitoring, online gaming and the like. WebSocket (and the Java API for WebSocket newly included in Java EE 7 :-)) is ideal for these cases. Between the seemingly diametric opposites of plain HTTP and WebSocket, there's also Server Sent Events (SSE). SSE is aimed at yet another scenario - a steam of events generated by the server and consumed passively by the client. Although not standardized in JAX-RS 2/Java EE 7, Jersey/GlassFish includes support for SSE.
In an very detailed blog post, Rahman Usta of the Istanbul JUG explains SSE and demonstrates a non-trivial use of the Jersey/GlassFish support for SSE.
Thursday Nov 21, 2013
By David Delabassee-Oracle on Nov 21, 2013
"Rest is the sweet sauce of labor." (Plutarch – a long time ago!)
Tracing is a feature that was available in Jersey 1.x, this feature has now been ported to Jersey 2.x (2.3 and above). The Jersey Tracing capabilities allows to easily diagnose server-side request processing pipelines. Libor Kramoliš, a member of the Jersey Team, has written a detailed post on how to use the Jersey's Tracing capability.
Friday Jul 06, 2012
By arungupta on Jul 06, 2012
TOTD #182 explains how to get started with creating a simple Maven-based application, deploying on GlassFish 4, and using the newly introduced Client API to test the REST endpoint.
GlassFish 4 contains Jersey 2 as the JAX-RS implementation. If you want to use Jersey 1.1 functionality, then Martin's blog provide more details on that. All JAX-RS 1.x functionality will be supported using standard APIs anyway. This workaround is only required if Jersey 1.x functionality needs to be accessed.
Here are some pointers to follow
- JAX-RS 2 Specification Early Draft 3
- Latest status on
- Latest JAX-RS 2.0 Javadocs
- Latest status on Jersey 2 (jersey.java.net)
- Latest Jersey API Javadocs
GlassFish 4.0 Promoted Build
- Follow @gf_jersey
Friday Apr 13, 2012
By arungupta on Apr 13, 2012
Recent Tips and News on Java, Java EE 6, GlassFish & more :
Wednesday Mar 28, 2012
By arungupta on Mar 28, 2012
Jersey 2.0 milestone 2 is now available. It builds upon the first milestone and adds several new features such as server-side asynchronous processing, server-side content negotiation, improved JAX-RS parameter injection, and several others.
The REST endpoints can be published on Java SE HTTP Server, Grizzly 2 HTTP container, and some basic Servlet-based deployments. It also provides HTTPURLConnection-based client API implementation. Read about these and more about what's new in Marek's detailed post. Of course this is also the future reference implementation for JAX-RS 2.0.
Feel like trying it out? Simply go to Maven Central (of course none of this is production quality at this point). The latest JAX-RS Javadocs and Jersey 2.0 API docs are good starting points to explore. And provide them feedback at firstname.lastname@example.org.
Sunday Mar 18, 2012
By alexismp on Mar 18, 2012
As reported previously here, the JAX-RS 2.0 (JSR 339) expert group is making good progress.
Marek discusses the new client API, filters/handlers, BeanValidation integration, Hypermedia support (HATEOAS), server-side async processing and more.
With JSR 339's Early Draft Review 2 currently out, another draft review is planned for April, the public review should be available in June while the final draft is currently scheduled for the end of the summer. In short, expect completion sometime before the end of 2012.
Podcasts & Videos
- JavaOne CFP is Open - Your Invitation to Submit to the Java EE Track
- New book: "Web Development with Java and JSF"
- Forge Powered Java EE Rapid Application Development Comes to NetBeans!
- JMS 2.0 Revision A
- Java EE 8/Adopt-a-JSR Updates: Morocco JUG!
- Java EE Management API 2.0 (JSR 373) Spins Up
- Java EE Container Lifecycle
- Migrating a JSF Application from Spring to Java EE 7/CDI
- Java EE 7 Hands-on-Lab Updated for You to Use!
- Templating in the MVC JSR