Java Reference
In-Depth Information
Clicking on the Enable Contexts and Dependency Injection checkbox has the effect
of creating a file called beans.xml and placing it in the WEB-INF directory of our web
application. The generated beans.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://
java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
When our application is deployed, the presence of this file indicates to the
application server that our application is CDI-enabled.
Typically, just like standard JSF applications, CDI applications use Facelets as their
view technology. The following example illustrates typical markup for a CDI page:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Create New Customer</title>
</h:head>
 
Search WWH ::




Custom Search