Home » CDI

Tag Archives: CDI

[New Webinar] Static vs. Dynamic Analysis: Two Foolproof ways to Ensure Your Code is Production-Ready

Join us for the webinar on Thursday, April 2nd at 11 am PT / 2 pm ET The stakes have never been higher for unexpected downtime. One critical error in production can translate to millions lost in revenue, brand loyalty and developer productivity. To combat this reality, more organizations are investing in shift left strategies, enhancing their testing processes and ...

Read More »

Strategy Pattern with CDI and lambdas

The strategy design pattern dynamically chooses an implementation algorithm, a strategy, at runtime. The pattern can be used to select different business algorithms depending on the circumstances. We could define different algorithm implementations as separate classes. Or we make use of Java SE 8 lambdas and functions, that serve as lightweight strategy implementation here. CDI is capable of injecting parameterized ...

Read More »

JSR 365 Update: Digging Into CDI 2.0

java-interview-questions-answers

Contexts and Dependency Injection 2.0 (JSR 365), is an update to CDI 1.2, which is currently part of the Java EE 7 platform.  It is currently in Public Review stage.  For those of you who are not very familiar with CDI, it defines a powerful set of complimentary services that act as a gel that help to improve the coordination and ...

Read More »

DynamicReports and JasperReports with JSF, Servlet and CDI

In this example, I will show how to integrate DynamicReport and JasperReports with Servlet and CDI. Tools: TIBCO Jaspersoft Studio-6.0.4.final. Eclipse  Luna Service Release 2 (4.4.2). WildFly 8.x application server. This is a screenshot from the project hierarchy on Eclipse.     The pom.xml file contains the required dependencies for the Servlets + JSF + CDI + DynamicReports. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...

Read More »

Creating JSF/CDI Maven project on Eclipse

While I was working on a JSF and CDI example, I thought it would be useful to mention the steps required to create JSF and CDI Maven project. You can find the bellow steps to do so. Tools Eclipse Luna that’s shipped with the M2E plugin by default. So no need to install the plugin yourself. WildFlye 8.x.     ...

Read More »

Native CDI Qualifiers: @Any and @Default

java-interview-questions-answers

Let’s take a look at the out-of-the-box qualifiers in CDI There are three qualifiers declared by the CDI specification – @Any, @Default, @New @Any: Think of it as an omnipresent qualifier. It’s there even if its not ;-) @Default: As the name suggests, this qualifier treated as a default when none other qualifiers have been specific. The only exception to ...

Read More »

A look on CDI 2.0 EDR1

java-interview-questions-answers

CDI is one of the best additions to Java EE of the recent. This opinion is widely shared amongst users and integrators. CDI 1.2, the current version, was released in April, 2014. Now in mid-2015, we face the early draft review of the CDI 2.0 spec. CDI 2.0 will run on Java 8 and higher. The final release is scheduled ...

Read More »