Skip to content

Commit

Permalink
lots of revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin King committed Nov 7, 2009
1 parent 4e2abb9 commit 9cfe7bb
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 293 deletions.
14 changes: 7 additions & 7 deletions reference/en-US/environments.xml
Expand Up @@ -14,15 +14,15 @@
<para>
If you are using JBoss AS &lt; 5.2, then you'll need to install Weld as an add-on. Fortunately, the
distribution has a build that can handle this for you in a single command. First, we need to tell Weld where
JBoss AS is located. Create a new file named local.build.properties in the examples directory of the Weld
distribution and assign the path of your JBoss AS installation to the property key
JBoss AS is located. Create a new file named <literal>local.build.properties</literal> in the examples directory
of the Weld distribution and assign the path of your JBoss AS installation to the property key
<literal>jboss.home</literal>, as follows:
</para>

<programlisting><![CDATA[jboss.home=/path/to/jboss-as-5.x]]></programlisting>

<para>
Now we can install the Weld deployer from the jboss-as directory of the Weld distribution:
Now we can install the Weld deployer from the <literal>jboss-as</literal> directory of the Weld distribution:
</para>

<programlisting>$> cd jboss-as
Expand Down Expand Up @@ -58,15 +58,15 @@ $> ant update</programlisting>
<title>Servlet containers (such as Tomcat or Jetty)</title>

<para>
While JSR-299 does not require support for Servlet environments, Weld can be used in any Servlet container,
While JSR-299 does not require support for servlet environments, Weld can be used in any servlet container,
such as Tomcat 6.0 or Jetty 6.1.
</para>

<note>
<para>
There is a major limitation to using a Servlet container. Weld doesn't support deploying session beans,
There is a major limitation to using a servlet container. Weld doesn't support deploying session beans,
injection using <literal>@EJB</literal> or <literal>@PersistenceContext</literal>, or using transactional
events in Servlet containers. For enterprise features such as these, you should really be looking at a Java
events in servlet containers. For enterprise features such as these, you should really be looking at a Java
EE application server.
</para>
</note>
Expand All @@ -75,7 +75,7 @@ $> ant update</programlisting>
Weld should be used as a web application library in a servlet container. You should place
<literal>weld-servlet.jar</literal> in <literal>WEB-INF/lib</literal> in the web root.
<literal>weld-servlet.jar</literal> is an "uber-jar", meaning it bundles all the bits of Weld and CDI required
for running in a Servlet container, provided for your convenience: Alternatively, you could use its component
for running in a servlet container, provided for your convenience. Alternatively, you could use its component
jars:
</para>

Expand Down
8 changes: 4 additions & 4 deletions reference/en-US/example.xml
Expand Up @@ -4,7 +4,7 @@
<title>JSF web application example</title>

<para>
Let's illustrate these ideas with a full example. We're going to implement a user login/logout for an application
Let's illustrate these ideas with a full example. We're going to implement user login/logout for an application
that uses JSF. First, we'll define a request-scoped bean to hold the username and password entered during login:
</para>

Expand Down Expand Up @@ -88,14 +88,14 @@ public @interface LoggedIn {}]]></programlisting>
public @interface UserDatabase {}]]></programlisting>

<para>
We need an adapter bean to expose our typesafe <literal>EntityManager</literal>:
We need an adaptor bean to expose our typesafe <literal>EntityManager</literal>:
</para>

<programlisting role="JAVA"><![CDATA[public class UserDatabaseProducer {
@Produces @UserDatabase @PersistenceContext EntityManager userDatabase;
}]]></programlisting>

<para>Now, any other bean can easily inject the current user, as well as other beans:</para>
<para>Now <literal>DocumentEditor</literal>, or any other bean, can easily inject the current user:</para>

<programlisting role="JAVA"><![CDATA[public class DocumentEditor {
@Inject Document document;
Expand All @@ -115,7 +115,7 @@ public @interface UserDatabase {}]]></programlisting>
</h:panelGroup>]]></programlisting>

<para>
Hopefully, this example gives a flavor of the CDI services. In the next chapter, we'll explore examples from the
Hopefully, this example gives a flavor of the CDI services. In the next chapter, we'll explore examples from the
CDI reference implementation, Weld, in greater depth.
</para>

Expand Down

0 comments on commit 9cfe7bb

Please sign in to comment.