JSF 2.3: UIData improvements
UIData improvementsIn JSF 2.3, <h:dataTable/> and <ui:repeat /> support Iterable and Map.Iterable exampleLet's create a simple demo to try it. The backing bean.@ModelpublicclassIterableBean...
View ArticleJSF 2.3: Class level validation with f:validateWholeBean
Class level validation with f:validateWholeBeanJSF provides a f:validateBean which bridges Bean Validation to JSF, why we need another f:validateWholeBean? This is explained in details in the VDL docs...
View ArticleJSF 2.3:Websocket support
Websocket supportOne of the most attractive features is JSF 2.3 added native websocket support, it means you can write real-time applications with JSF and no need extra effort. To enable websocket...
View ArticleJSON-B 1.0
JSON-B 1.0JSON-P provides the lower JSON node operations, JSON Binding API provides advanced operations on serialization of Java objects to JSON string and deserialization of JSON string to Java...
View ArticleJSON-P 1.1
JSON-P 1.1JSON processing APIs is updated and aligned with Java 8, and provides Stream support for JSON reader. Let's create an example to demonstrate it.publicclassPersonimplementsSerializable...
View ArticleCDI 2.0: Java SE support
Java SE supportThe Java SE support in weld is now standardized, it is useful when you want to get CDI support out of Java EE application servers. Given a simple CDI...
View ArticleCDI 2.0: Handle Events in desired Priority
Handle Events in desired PriorityIf there are multi CDI @Obsevers emthods defined, in the former CDI, there is no way to ensure they are excuted in a certain order. In CDI 2.0, this gap is filled by...
View ArticleCDI 2.0: Fire events asynchronously
Fire events asynchronouslyCDI 2.0 add the capability of firing an CDI event asynchronously, this will free the client from long-awaited blocking rquest. Create a simple backing...
View ArticleCDI 2.0: Register Beans dynamicially
Register Beans dynamiciallyBefore CDI 2.0 register a bean dynamicially is a little complex. CDI 2.0 simple the work.publicvoid addABean(@ObservesAfterBeanDiscovery event) {// get an instance of...
View ArticleCDI 2.0: Configurators APIs and Intercept Producers
Configurators APIs and Intercept ProducersIn CDI 2.0, it is possible to add Interceptor to a producer programmaticially. For example, there is a POJO.public class Greeter { public Greeter() { } public...
View ArticleBean Validation 2.0(JSR380)
Bean Validation 2.0(JSR380)Bean Validation 2.0 added more alignments with Java 8 and CDI, and bring a series of new annotations.Supports Java 8 Datetime and Optional.Supports annotations applied on...
View ArticleJPA 2.2: More CDI Alignments
More CDI AlignmentsIn JPA 2.1, EntityListener supports @Inject(some persistence providers are still problematic). JPA 2.2 adds injection support in @AttributeConverter. Let's reuse the sample codes in...
View ArticleJPA 2.2: Java 8 Datetime support
Java 8 Datetime supportIn the former version, there are some approaches to add Java Datetime support by yourself.Custom AttributeConverter, I descirbed here. Spring Data JPA also provides...
View ArticleJPA 2.2: Support Stream as query result
Support Stream as query resultHibernate has already added a lot of alignments with Java 8, Stream and Optional are supported. JPA 2.2 add official support for Stream result of query. The following...
View ArticleJAX-RS 2.1: Async improvements
Async improvementsIn JAXRS 2.0, you can build an asynchronous RESTful APIs as the following.@GETpublicvoid getAsync(final@SuspendedAsyncResponse res) { res.setTimeoutHandler( (ar) -> {...
View ArticleJAX-RS 2.1: Reactive Client
Reactive ClientIn JAXRS 2.0, a client to handle async resources looks like.publicclassAsyncClient {publicfinalstaticvoidmain(String[] args) throwsException {WebTarget target...
View ArticleJAX-RS 2.1: Server Sent Event
Server Sent EventJersey itself supports SSE for years, now it is standardized as a part of JAXRS 2.1. A simple SSE example.@Path("events")@RequestScopedpublicclassSseResource...
View ArticleServlet 4.0: HTTP/2 Server PUSH
Server PushOne highlight feature of HTTP/2 is Server Push. Servlet 4.0 add PushBuilder to handle push. An exmaple of enable Servlet...
View ArticleServlet 4.0: Runtime Discovery of Servlet Mappings
Runtime Discovery of Servlet MappingsWhen a servlet is activated, the mapping info can be discoverable at runtime. Described in the Servlet spcefication.The method getHttpServletMapping() on...
View ArticleServlet 4.0: Http Trailer
Http TrailerServlet 4.0 added Http Trailer(RFC 7230) supports, which is a specific collection of http headers comes after response body. It is useful in some case, such as chunked transfer encoding or...
View ArticleJava EE Security API 1.0: HTTP authentication
HTTP authenticationHttpAuthenticationMechanism allow customsize your own HTTP authentication mechanism. An examples for custom...
View ArticleJava EE Security API 1.0: IdentityStore
There are two built-in IdentityStore implementations provided in Glassfish v5, Database or Ldap. An example of using built-in @DatabaseIdentityStoreDefinition to setup database based...
View ArticleJava EE Security API 1.0: SecurityContext
SecurityContextIn Java EE 7 or earlier versions, other specfications, such as Servelt, EJB, JAX-RS, JAX-WS, etc. have their own specific APIs to query current security context.Servlet -...
View ArticleBuild a Reactive application with Angular 5 and Spring Boot 2.0
I have created a post to describe Reactive programming supports in Spring 5 and its subprojects, all codes of this article are updated the latest Spring 5 RELEASE, check spring-reactive-sample under my...
View ArticleSecures your applications with Spring Security 5 and Keycloak
Spring Security 5 brought new OAuth2/OIDC client instead of the legacy client support in the old Spring Security OAuth sub project. The new OAuth2 umbrella modules in the core project will replace the...
View Article