[jboss-cvs] JBossAS SVN: r91848 - in projects/docs/enterprise/5.0: RESTEasy and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 30 18:41:36 EDT 2009


Author: laubai
Date: 2009-07-30 18:41:35 -0400 (Thu, 30 Jul 2009)
New Revision: 91848

Added:
   projects/docs/enterprise/5.0/RESTEasy/
   projects/docs/enterprise/5.0/RESTEasy/Makefile
   projects/docs/enterprise/5.0/RESTEasy/en-US/
   projects/docs/enterprise/5.0/RESTEasy/en-US/Async_job_service.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Asynchronous_HTTP.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Atom.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Book_Info.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Cache_NoCache_CacheControl.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Configuring_Individual_JAX-RS_Resource_Beans.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Content_Marshalling_Providers.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/ExceptionMappers.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Guice1.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Installation_Configuration.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Interceptors.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Content_Negotiation.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Resource_Locators_and_Sub_Resources.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/JBoss.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Jaxb.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Json.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Maven_and_RESTEasy.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Migration_from_older_versions.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Multipart.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Overview.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Client_Framework.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_EJB_Integration.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Embedded_Container.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Reference_Guide.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Server-side_Mock_Framework.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Spring_Integration.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Responses_using_coreResponse.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Revision_History.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Seam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Securing_JAX-RS_and_RESTeasy.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/StringConverter.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Using_Path.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/Yaml.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_Context.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_CookieParam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_DefaultValue.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_Encoded_and_encoding.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_Form.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_FormParam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_HeaderParam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_MatrixParam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_PathParam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/_QueryParam.xml
   projects/docs/enterprise/5.0/RESTEasy/en-US/gzip.xml
Log:
Almost-buildable docs.

Added: projects/docs/enterprise/5.0/RESTEasy/Makefile
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/Makefile	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/Makefile	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,15 @@
+#Makefile for Red Hat Documentation
+#Created by Jeff Fearn <jfearn at redhat.com>
+#Copyright Red Hat Inc. 2006
+
+XML_LANG	= en-US
+DOCNAME		= Seam_Reference_Guide
+PRODUCT		= Seam_Framework
+BRAND		= common
+
+TRANSLATIONS    = $(XML_LANG)
+OTHER_LANGS    = as-IN bn-IN de-DE es-ES es-MX fr-FR gu-IN hi-IN it-IT ja-JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK sl-SL ta-IN te-IN zh-CN zh-TW
+#TRANSLATIONS   = $(XML_LANG) $(OTHER_LANGS)
+
+COMMON_CONFIG  = /usr/share/publican
+include $(COMMON_CONFIG)/make/Makefile.common

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Async_job_service.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Async_job_service.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Async_job_service.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,129 @@
+<chapter id="async_job_service">
+   <title>Asynchronous Job Service</title>
+   <para>
+      The RESTEasy Asynchronous Job Service is an implementation of the Asynchronous Job pattern defined in O'Reilly's <citetitle>Restful Web Services</citetitle>. It is designed to add asynchronicity to a synchronous protocol.
+   </para>
+   <section id="async_job">
+     <title>Using Async Jobs</title>
+      <para>
+	While HTTP is a synchronous protocol, it is capable of dealing with asynchronous invocations. The HTTP 1.1 response code <literal>202</literal> (Accepted) means that the server has received and accepted the response for processing, but that processing is not yet complete. The RESTEasy Asynchronous Job Service is based on this type of response.
+   </para>
+<programlisting>
+POST http://example.com/myservice?asynch=true
+</programlisting>
+   <para>
+    For example, if you make the above post with the <literal>asynch</literal> query parameter set to <literal>true</literal>, RESTEasy returns a <literal>202</literal> (Accepted) response code and runs the invocation in the background. It also returns a Location header with a URL pointing to the location of the background method's response.
+   </para>
+<programlisting>
+HTTP/1.1 202 Accepted
+Location: http://example.com/asynch/jobs/3332334
+</programlisting>
+   <para>
+   The URI will have the form of:
+   </para>
+<programlisting>
+/asynch/jobs/{job-id}?wait={millisconds}|nowait=true
+</programlisting>
+   <para>
+      You can perform <literal>GET</literal>, <literal>POST</literal> and <literal>DELETE</literal> operations on this job URL. <literal>GET</literal> returns the response of the JAX-RS resource method, if the job has completed. If the job has not completed, this <literal>GET</literal> returns a response code of <literal>202</literal> (Accepted). Invoking <literal>GET</literal> does not remove the job, so it can be called multiple times. When RESTEasy's job queue becomes full, it will evict the least recently used job from memory. You can clean the queue manually by calling <literal>DELETE</literal> on the URI. <literal>POST</literal> reads the <literal>JOB</literal> response and removes the <literal>JOB</literal> when it has completed.
+    </para>
+    <para>
+      Both <literal>GET</literal> and <literal>POST</literal> let you specify a mazimum wait time in milliseconds &#8212; a <literal>wait</literal> query parameter. For example:
+    </para>
+<programlisting>
+POST http://example.com/asynch/jobs/122?wait=3000
+</programlisting>
+    <para>
+      If you do not specify a <literal>wait</literal> parameter, the <literal>GET</literal> or <literal>POST</literal> will not wait at all if the job is not complete.
+    </para>
+    <note>
+      <para>
+	While you can invoke <literal>GET</literal>, <literal>DELETE</literal>, and <literal>PUT</literal> methods asynchronously, this breaks the HTTP 1.1 contract of these methods. These invocations may not change the state of the resource if invoked more than once, but they do change the state of the server. Try to invoke POST methods asynchronously.
+      </para>
+    </note>
+    <important>
+      <title>Security in the Asynchronous Job Service</title>
+      <para>
+	RESTEasy role-based security (annotations) does not work with the Asynchronous Job Service. <emphasis>You must use XML declarative security within your <filename>web.xml</filename> file.</emphasis> It is currently impossible to implement role-based security portably. In the future, we may have specific JBoss integration, but will not support other environments.
+      </para>
+    </important>
+   </section>
+   <section id="oneway">
+      <title>Oneway: Fire and Forget</title>
+      <para>
+         RESTEasy also supports the notion of <emphasis>fire and forget</emphasis>. This returns a <literal>202</literal> (Accepted) response, but no Job is created. Use the <literal>oneway</literal> query parameter instead of <literal>asynch</literal>, like so:
+      </para>
+<programlisting>
+POST http://example.com/myservice?oneway=true
+</programlisting>
+    <important>
+      <title>Security in the Asynchronous Job Service</title>
+      <para>
+	RESTEasy role-based security (annotations) does not work with the Asynchronous Job Service. <emphasis>You must use XML declarative security within your <filename>web.xml</filename> file.</emphasis> It is currently impossible to implement role-based security portably. In the future, we may have specific JBoss integration, but will not support other environments.
+      </para>
+    </important>
+   </section>
+   <section id="async_job_setup">
+     <title>Setup and Configuration</title>
+      <para>
+	The Asynchronous Job Service is not enabled by default, so you will need to enable it in your <filename>web.xml</filename>:
+      </para>
+<programlisting>
+&lt;![CDATA[
+&lt;web-app&gt;
+    &lt;!-- enable the Asynchronous Job Service --&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.async.job.service.enabled&lt;/param-name&gt;
+        &lt;param-value&gt;true&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;!-- The next context parameters are all optional.  
+         Their default values are shown as example param-values --&gt;
+
+    &lt;!-- How many jobs results can be held in memory at once? --&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.async.job.service.max.job.results&lt;/param-name&gt;
+        &lt;param-value&gt;100&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;!-- Maximum wait time on a job when a client is querying for it --&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.async.job.service.max.wait&lt;/param-name&gt;
+        &lt;param-value&gt;300000&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;!-- Thread pool size of background threads that run the job --&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.async.job.service.thread.pool.size&lt;/param-name&gt;
+        &lt;param-value&gt;100&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;!-- Set the base path for the Job uris --&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.async.job.service.base.path&lt;/param-name&gt;
+        &lt;param-value&gt;/asynch/jobs&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;listener&gt;
+        &lt;listener-class&gt;
+            org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
+        &lt;/listener-class&gt;
+    &lt;/listener&gt;
+
+    &lt;servlet&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;servlet-class&gt;
+            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+        &lt;/servlet-class&gt;
+    &lt;/servlet&gt;
+
+    &lt;servlet-mapping&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+    &lt;/servlet-mapping&gt;
+
+&lt;/web-app&gt;
+]]&gt;
+</programlisting>
+   </section>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Asynchronous_HTTP.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Asynchronous_HTTP.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Asynchronous_HTTP.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,120 @@
+<chapter id="Asynchronous_HTTP_Request_Processing">
+   <title>Asynchronous HTTP Request Processing</title>
+   <para>
+      Asynchronous HTTP Request Processing lets you process a single HTTP request using NIO (Non-blocking Input/Output), in separate threads (if desired). This is also known as <emphasis>COMET capability</emphasis>. The primary use case for Asynchronous HTTP is where the client polls the server for a delayed response.
+    </para>
+    <para>
+      A common example is an AJAX chat client that pushes/pulls from both the client and the server. In this scenario, the client blocks a long period of time on the server's socket while waiting for a new message. In synchronous HTTP (where the server blocks on incoming and outgoing I/O), one thread is consumed per client connection, which consumes both memory and thread resources. When multiple concurrent clients block in this way, resources are not used effectively, and the server does not scale well.
+   </para>
+   <para>
+      Tomcat, Jetty, and JBoss Web all have similar (proprietary) support for asynchronous HTTP request processing. This functionality is currently being standardized in the Servlet 3.0 specification. RESTEasy provides a simple callback API to provide asynchronous capabilities, and supports integration with Servlet 3.0 (through Jetty 7), Tomcat 6, and JBoss Web 2.1.1.
+   </para>
+   <para>
+      The RESTEasy asynchronous HTTP support is implemented via two classes: the <literal>@Suspend</literal> annotation and the <literal>AsynchronousResponse</literal> interface.
+   </para>
+   <programlisting>
+public @interface Suspend
+{
+   long value() default -1;
+}
+
+import javax.ws.rs.core.Response;
+
+public interface AsynchronousResponse
+{
+   void setResponse(Response response);
+}
+   </programlisting>
+   <para>
+      <literal>@Suspend</literal> tells RESTEasy that the HTTP request/response should be detached from the currently executing thread, and that the current thread should not automatically process the response. The argument to <literal>@Suspend</literal> is the time in milliseconds until the request should be cancelled.
+   </para>
+   <para>
+      <literal>AsynchronousResponse</literal> is the callback object. It is injected into the method by RESTEasy. Application code moves the <literal>AsynchronousResponse</literal> to a different thread for processing. Calling <literal>setResponse()</literal> returns a response to the client and terminates the HTTP request. The following is an example of asynchronous processing:
+   </para>
+
+
+   <programlisting>
+import org.jboss.resteasy.annotations.Suspend;
+import org.jboss.resteasy.spi.AsynchronousResponse;
+
+ at Path("/")
+public class SimpleResource
+{
+
+   @GET
+   @Path("basic")
+   @Produces("text/plain")
+   public void getBasic(final @Suspend(10000) AsynchronousResponse response) throws Exception
+   {
+      Thread t = new Thread()
+      {
+         @Override
+         public void run()
+         {
+            try
+            {
+               Response jaxrs = Response.ok("basic").type(MediaType.TEXT_PLAIN).build();
+               response.setResponse(jaxrs);
+            }
+            catch (Exception e)
+            {
+               e.printStackTrace();
+            }
+         }
+      };
+      t.start();
+   }
+}
+   </programlisting>
+   <section id="Asynch_HTTP_Tomcat6">
+      <title>Tomcat 6 and JBoss 4.2.3 Support</title>
+      <para>
+	  To use RESTEasy's Asynchronous HTTP APIs with Tomcat 6 or JBoss 4.2.3, you must use a special RESTEasy Servlet and configure Tomcat (or JBoss Web in JBoss 4.2.3) to use the NIO transport. First, edit Tomcat's (or JBoss Web's) <filename>server.xml</filename> file. Comment out the <literal>vanilla HTTP adapter</literal> and add the following:
+      </para>
+      <programlisting>
+&lt;Connector port="8080" address="${jboss.bind.address}"
+   emptySessionPath="true" protocol="org.apache.coyote.http11.Http11NioProtocol"
+   enableLookups="false" redirectPort="6443" acceptorThreadCount="2" pollerThreadCount="10"
+/&gt;
+      </programlisting>
+      <para>
+	  Your deployed RESTEasy applications must also use a different RESTEasy Servlet: <literal>org.jboss.resteasy.plugins.server.servlet.Tomcat6CometDispatcherServlet</literal>. This class is available within the <filename>async-http-tomcat-xxx.jar</filename> (or within the Maven repository, under the <literal>async-http-tomcat6</literal> artifact ID) in <filename>web.xml</filename>.
+      </para>
+      <programlisting>
+&lt;servlet&gt;
+   &lt;servlet-name>Resteasy&lt;/servlet-name&gt;
+   &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.Tomcat6CometDispatcherServlet&lt;/servlet-class&gt;
+&lt;/servlet&gt;
+      </programlisting>
+   </section>
+   <section id="Asynch_HTTP_Servlet3">
+      <title>Servlet 3.0 Support</title>
+      <para>
+	  As of October 20th, 2008, only Jetty 7.0.pre3 (mortbay.org) supported the current draft of the unfinished Servlet 3.0 specification.
+      </para>
+      <para>
+	  Your deployed RESTEasy applications must also use a different RESTEasy Servlet: <literal>org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher</literal>. This class is available within the <filename>async-http-servlet-3.0-xxx.jar</filename> (or within the Maven repository under the <literal>async-http-servlet-3.0</literal> artifact ID) in <filename>web.xml</filename>:
+      </para>
+      <programlisting>
+&lt;servlet&gt;
+   &lt;servlet-name>Resteasy&lt;/servlet-name&gt;
+   &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher&lt;/servlet-class&gt;
+&lt;/servlet&gt;
+      </programlisting>
+   </section>
+   <section id="Asynch_HTTP_JBossWeb">
+      <title>JBossWeb, JBoss AS 5.0.x Support</title>
+      <para>
+         The JBossWeb container is shipped with JBoss AS 5.0.x and higher requires the JBoss Native plugin to enable asynchronous HTTP processing. See the JBoss Web documentation for information about this process.
+      </para>
+      <para>
+         Your deployed RESTEasy applications must use a different RESTEasy Servlet: <literal>org.jboss.resteasy.plugins.server.servlet.JBossWebDispatcherServlet</literal>. This class is available within the <filename>async-http-jbossweb-xxx.jar</filename> (or within the Maven repository under the <literal>async-http-jbossweb</literal> artifact ID) in <filename>web.xml</filename>:
+      </para>
+      <programlisting>
+&lt;servlet&gt;
+   &lt;servlet-name>Resteasy&lt;/servlet-name&gt;
+   &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.JBossWebDispatcherServlet&lt;/servlet-class&gt;
+&lt;/servlet&gt;
+      </programlisting>
+   </section>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Atom.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Atom.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Atom.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,345 @@
+<chapter id="Atom">
+   <title>Resteasy Atom Support</title>
+   <para>
+      From W3.org (http://tools.ietf.org/html/rfc4287):
+   </para>
+   <para>
+      "Atom is an XML-based document format that describes lists of related
+      information known as "feeds". Feeds are composed of a number of
+      items, known as "entries", each with an extensible set of attached
+      metadata. For example, each entry has a title.
+
+      The primary use case that Atom addresses is the syndication of Web
+      content such as weblogs and news headlines to Web sites as well as
+      directly to user agents."
+   </para>
+   <para>
+      Atom is the next-gen RSS feed. Although it is used primarily for the syndication of blogs and news, many
+      are starting to use this format as the envelope for Web Services, for example, distributed notifications, job
+      queues, or simply a nice format for sending or receiving data in bulk from a service.
+   </para>
+   <section id="resteasy_atom">
+      <title>Resteasy Atom API and Provider</title>
+      <para>RESTEasy has defined a simple object model in Java to represent Atom and uses JAXB to marshal and unmarshal
+         it. The
+         main classes are in the org.jboss.resteasy.plugins.providers.atom package and are Feed, Entry, Content, and
+         Link. If you
+         look at the source, you'd see that these are annotated with JAXB annotations. The distribution contains
+         the javadocs for this project and are a must to learn the model. Here is a simple example of sending
+         an atom feed using the Resteasy API.
+      </para>
+      <programlisting><![CDATA[
+import org.jboss.resteasy.plugins.providers.atom.Content;
+import org.jboss.resteasy.plugins.providers.atom.Entry;
+import org.jboss.resteasy.plugins.providers.atom.Feed;
+import org.jboss.resteasy.plugins.providers.atom.Link;
+import org.jboss.resteasy.plugins.providers.atom.Person;
+
+ at Path("atom")
+public class MyAtomService
+{
+
+   @GET
+   @Path("feed")
+   @Produces("application/atom+xml")
+   public Feed getFeed() throws URISyntaxException
+   {
+      Feed feed = new Feed();
+      feed.setId(new URI("http://example.com/42"));
+      feed.setTitle("My Feed");
+      feed.setUpdated(new Date());
+      Link link = new Link();
+      link.setHref(new URI("http://localhost"));
+      link.setRel("edit");
+      feed.getLinks().add(link);
+      feed.getAuthors().add(new Person("Bill Burke"));
+      Entry entry = new Entry();
+      entry.setTitle("Hello World");
+      Content content = new Content();
+      content.setType(MediaType.TEXT_HTML_TYPE);
+      content.setText("Nothing much");
+      entry.setContent(content);
+      feed.getEntries().add(entry);
+      return feed;
+   }
+}
+]]>
+      </programlisting>
+      <para>Because Resteasy's atom provider is JAXB based, you are not limited to sending atom objects using XML.
+         You can automatically re-use all the other JAXB providers that Resteasy has like JSON and fastinfoset.
+         All you have to do is have "atom+" in front of the main subtype. i.e. @Produces("application/atom+json") or
+         @Consumes("application/atom+fastinfoset")
+      </para>
+   </section>
+   <section id="jaxb_atom">
+      <title>Using JAXB with the Atom Provider</title>
+      <para>
+         The org.jboss.resteasy.plugins.providers.atom.Content class allows you to unmarshal and marshal JAXB
+         annotated objects that are the body of the content. Here's an example of sending an Entry with
+         a Customer object attached as the body of the entry's content.
+      </para>
+      <programlisting><![CDATA[
+ at XmlRootElement(namespace = "http://jboss.org/Customer")
+ at XmlAccessorType(XmlAccessType.FIELD)
+public class Customer
+{
+   @XmlElement
+   private String name;
+
+   public Customer()
+   {
+   }
+
+   public Customer(String name)
+   {
+      this.name = name;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+}
+
+ at Path("atom")
+public static class AtomServer
+{
+   @GET
+   @Path("entry")
+   @Produces("application/atom+xml")
+   public Entry getEntry()
+   {
+      Entry entry = new Entry();
+      entry.setTitle("Hello World");
+      Content content = new Content();
+      content.setJAXBObject(new Customer("bill"));
+      entry.setContent(content);
+      return entry;
+   }
+}
+]]></programlisting>
+      <para>
+         The Content.setJAXBObject() method is used to tell the content object you are sending back
+         a Java JAXB object and want it marshalled appropriately. If you are using a different base
+         format other than XML, i.e. "application/atom+json", this attached JAXB object will be marshalled
+         into that same format.
+      </para>
+      <para>
+         If you have an atom document as your input, you can also extract JAXB objects from Content using the
+         Content.getJAXBObject(Class clazz) method. Here is an example of an input atom document and extracting
+         a Customer object from the content.
+      </para>
+      <programlisting><![CDATA[
+ at Path("atom")
+public static class AtomServer
+{
+   @PUT
+   @Path("entry")
+   @Produces("application/atom+xml")
+   public void putCustomer(Entry entry)
+   {
+      Content content = entry.getContent();
+      Customer cust = content.getJAXBObject(Customer.class);
+   }
+}
+]]></programlisting>
+   </section>
+
+<section id="Abdera">
+<title>Atom support through Apache Abdera</title>
+<para>
+   Resteasy provides support for Apache Abdera, an implementation of the Atom protocol and data format.
+   http://incubator.apache.org/abdera/
+</para>
+<para>
+   Abdera is a full-fledged Atom server. Resteasy only supports integration with JAX-RS for Atom data format
+   marshalling and unmarshalling to and from the Feed and Entry interface types in Abdera. Here's a simple example:
+</para>
+<section id="Abdera and Maven">
+   <title>Abdera and Maven</title>
+   <para>The Abdera provider is not included with the Resteasy distribution. To include the Abdera provider
+      in your WAR poms, include the following. Please change the version to be the version of resteasy you
+      are working with. Also, Resteasy may be coded to pick up an older version of Abdera than what you want. You're
+      on your own with fixing this one, sorry.
+   </para>
+   <programlisting><![CDATA[
+   <repository>
+      <id>jboss</id>
+      <url>http://repository.jboss.org/maven2</url>
+   </repository>
+
+      ...
+   <dependency>
+      <groupId>org.jboss.resteasy</groupId>
+      <artifactId>abdera-atom-provider</artifactId>
+      <version>...version...</version>
+   </dependency>
+]]></programlisting>
+</section>
+<section id="using_abdera">
+   <title>Using the Abdera Provider</title>
+   <programlisting>&lt;![CDATA[
+import org.apache.abdera.Abdera;
+import org.apache.abdera.factory.Factory;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.resteasy.plugins.providers.atom.AbderaEntryProvider;
+import org.jboss.resteasy.plugins.providers.atom.AbderaFeedProvider;
+import org.jboss.resteasy.test.BaseResourceTest;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriInfo;
+import javax.xml.bind.JAXBContext;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class AbderaTest extends BaseResourceTest
+{
+
+   @Path("atom")
+   public static class MyResource
+   {
+      private static final Abdera abdera = new Abdera();
+
+      @GET
+      @Path("feed")
+      @Produces(MediaType.APPLICATION_ATOM_XML)
+      public Feed getFeed(@Context UriInfo uri) throws Exception
+      {
+         Factory factory = abdera.getFactory();
+         Assert.assertNotNull(factory);
+         Feed feed = abdera.getFactory().newFeed();
+         feed.setId("tag:example.org,2007:/foo");
+         feed.setTitle("Test Feed");
+         feed.setSubtitle("Feed subtitle");
+         feed.setUpdated(new Date());
+         feed.addAuthor("James Snell");
+         feed.addLink("http://example.com");
+
+
+         Entry entry = feed.addEntry();
+         entry.setId("tag:example.org,2007:/foo/entries/1");
+         entry.setTitle("Entry title");
+         entry.setUpdated(new Date());
+         entry.setPublished(new Date());
+         entry.addLink(uri.getRequestUri().toString());
+
+         Customer cust = new Customer("bill");
+
+         JAXBContext ctx = JAXBContext.newInstance(Customer.class);
+         StringWriter writer = new StringWriter();
+         ctx.createMarshaller().marshal(cust, writer);
+         entry.setContent(writer.toString(), "application/xml");
+         return feed;
+
+      }
+
+      @PUT
+      @Path("feed")
+      @Consumes(MediaType.APPLICATION_ATOM_XML)
+      public void putFeed(Feed feed) throws Exception
+      {
+         String content = feed.getEntries().get(0).getContent();
+         JAXBContext ctx = JAXBContext.newInstance(Customer.class);
+         Customer cust = (Customer) ctx.createUnmarshaller().unmarshal(new StringReader(content));
+         Assert.assertEquals("bill", cust.getName());
+
+      }
+
+      @GET
+      @Path("entry")
+      @Produces(MediaType.APPLICATION_ATOM_XML)
+      public Entry getEntry(@Context UriInfo uri) throws Exception
+      {
+         Entry entry = abdera.getFactory().newEntry();
+         entry.setId("tag:example.org,2007:/foo/entries/1");
+         entry.setTitle("Entry title");
+         entry.setUpdated(new Date());
+         entry.setPublished(new Date());
+         entry.addLink(uri.getRequestUri().toString());
+
+         Customer cust = new Customer("bill");
+
+         JAXBContext ctx = JAXBContext.newInstance(Customer.class);
+         StringWriter writer = new StringWriter();
+         ctx.createMarshaller().marshal(cust, writer);
+         entry.setContent(writer.toString(), "application/xml");
+         return entry;
+
+      }
+
+      @PUT
+      @Path("entry")
+      @Consumes(MediaType.APPLICATION_ATOM_XML)
+      public void putFeed(Entry entry) throws Exception
+      {
+         String content = entry.getContent();
+         JAXBContext ctx = JAXBContext.newInstance(Customer.class);
+         Customer cust = (Customer) ctx.createUnmarshaller().unmarshal(new StringReader(content));
+         Assert.assertEquals("bill", cust.getName());
+
+      }
+   }
+
+   @Before
+   public void setUp() throws Exception
+   {
+      dispatcher.getProviderFactory().registerProvider(AbderaFeedProvider.class);
+      dispatcher.getProviderFactory().registerProvider(AbderaEntryProvider.class);
+      dispatcher.getRegistry().addPerRequestResource(MyResource.class);
+   }
+
+   @Test
+   public void testAbderaFeed() throws Exception
+   {
+      HttpClient client = new HttpClient();
+      GetMethod method = new GetMethod("http://localhost:8081/atom/feed");
+      int status = client.executeMethod(method);
+      Assert.assertEquals(200, status);
+      String str = method.getResponseBodyAsString();
+
+      PutMethod put = new PutMethod("http://localhost:8081/atom/feed");
+      put.setRequestEntity(new StringRequestEntity(str, MediaType.APPLICATION_ATOM_XML, null));
+      status = client.executeMethod(put);
+      Assert.assertEquals(200, status);
+
+   }
+
+   @Test
+   public void testAbderaEntry() throws Exception
+   {
+      HttpClient client = new HttpClient();
+      GetMethod method = new GetMethod("http://localhost:8081/atom/entry");
+      int status = client.executeMethod(method);
+      Assert.assertEquals(200, status);
+      String str = method.getResponseBodyAsString();
+
+      PutMethod put = new PutMethod("http://localhost:8081/atom/entry");
+      put.setRequestEntity(new StringRequestEntity(str, MediaType.APPLICATION_ATOM_XML, null));
+      status = client.executeMethod(put);
+      Assert.assertEquals(200, status);
+   }
+}
+]]&gt;
+   </programlisting>
+</section>
+</section>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Book_Info.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Book_Info.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Book_Info.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,28 @@
+<?xml version='1.0'?>
+<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+]>
+
+<bookinfo id="RichFaces_Reference_Guide">
+    <title>RichFaces Reference Guide</title>
+    <productname>JBoss Enterprise Application Platform</productname>
+    <productnumber>5.0</productnumber>
+    <edition>0</edition>
+    <pubsnumber>0</pubsnumber>
+    <corpauthor>
+        <inlinemediaobject>
+            <imageobject>
+                <imagedata format='SVG' fileref="Common_Content/images/title_logo.svg" />
+            </imageobject>
+            <textobject><phrase>Logo</phrase></textobject>
+        </inlinemediaobject>
+    </corpauthor>
+    <copyright>
+        <year>&YEAR;</year>
+        <holder>&HOLDER;</holder>
+    </copyright>
+    <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</bookinfo>
+
+
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Cache_NoCache_CacheControl.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Cache_NoCache_CacheControl.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Cache_NoCache_CacheControl.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,160 @@
+<chapter id="Cache_NoCache_CacheControl">
+   <title>RESTEasy Caching Features</title>
+   <para>
+      RESTEasy provides a number of annotations to support HTTP caching semantics, to simplify processes such as setting Cache-Control headers, and to make both server-side and client-side in-memory caches available.
+   </para>
+  <section id="Cache_Annotation">
+  <title>@Cache and @NoCache Annotations</title>
+   <para>
+      RESTEasy provides an extension to JAX-RS that lets you set <literal>Cache-Control</literal> headers on successful GET requests. It can only be used on methods annotated with <literal>@GET</literal>. Successful get requests return a response of <literal>200 OK</literal>.
+   </para>
+   <programlisting>
+package org.jboss.resteasy.annotations.cache;
+
+public @interface Cache
+{
+   int maxAge() default -1;
+   int sMaxAge() default -1;
+   boolean noStore() default false;
+   boolean noTransform() default false;
+   boolean mustRevalidate() default false;
+   boolean proxyRevalidate() default false;
+   boolean isPrivate() default false;
+}
+
+public @interface NoCache
+{
+   String[] fields() default {};
+}
+
+   </programlisting>
+   <para>
+      <literal>@Cache</literal> builds a complex <literal>Cache-Control</literal> header; <literal>@NoCache</literal> specifies that you do not want anything to be cached. (That is, <literal>Cache-Control: nocache</literal>.)
+   </para>
+   <para>
+      You can place these annotations on the resource class or interface, or place them on each individual <literal>@GET</literal> resource method. They specify a default cache value for each <literal>@GET</literal> resource method.
+   </para>
+   </section>
+   <section id="client_cache">
+     <title>Client "Browser" Cache</title>
+     <para>
+	RESTEasy can create a client-side, browser-like cache for use with the Client Proxy Framework or with raw <literal>ClientRequest</literal>s. This cache locates <literal>Cache-Control</literal> headers that are returned with a server response. If the <literal>Cache-Control</literal> headers specify that the client may cache the response, RESTEasy caches it within local memory. This cache obeys <literal>max-age</literal> requirements, and automatically performs HTTP 1.1 cache revalidation if either or both of the <literal>Last-Modified</literal> or <literal>ETag</literal> headers are returned with the original response. (See the HTTP 1.1 specification for details about <literal>Cache-Control</literal> or cache revalidation.)
+     </para>
+     <para>
+	Enabling RESTEasy caching is simple. The following shows the client cache being used with the Client Proxy Framework:
+      </para>
+<programlisting>
+ at Path("/orders")
+public interface OrderServiceClient {
+
+   @Path("{id}")
+   @GET
+   @Produces("application/xml")
+   public Order getOrder(@PathParam("id") String id);
+}
+</programlisting>
+    <para>
+	You can create a proxy for this interface and enable caching for that proxy like so:
+    </para>
+<programlisting>
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.client.cache.CacheFactory;
+import org.jboss.resteasy.client.cache.LightweightBrowserCache;
+
+public static void main(String[] args) throws Exception
+{
+      RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
+      OrderServiceClient proxy = ProxyFactory.create(OrderServiceClient.class, generateBaseUrl());
+
+      // This line enables caching
+      LightweightBrowserCache cache = CacheFactory.makeCacheable(proxy);
+}
+</programlisting>
+   <para>
+      If you are using the <literal>ClientRequest</literal> class instead of the proxy server to perform invocations, you can enable the cache like so:
+    </para>
+<programlisting>
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.client.cache.CacheFactory;
+import org.jboss.resteasy.client.cache.LightweightBrowserCache;
+
+public static void main(String[] args) throws Exception
+{
+      RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
+
+      // This line enables caching
+      LightweightBrowserCache cache = new LightweightBrowserCache();
+
+      ClientRequest request = new ClientRequest("http://example.com/orders/333");
+      CacheFactory.makeCacheable(request, cache);
+}
+</programlisting>
+   <para>
+      By default, the <literal>LightweightBrowserCache</literal> has a maximum caching space of two megabytes. You can change this programmatically by calling the <literal>setMaxBytes()</literal> method. <emphasis>If the cache becomes full, all cached data will be deleted automatically.</emphasis> For more complex caching solutions, or support for third-party cache options, contact the resteasy-development list and discuss your ideas with the community. <!--#modify: mailto?-->
+   </para>
+   </section>
+   <section id="server_cache">
+      <title>Local Server-Side Response Cache</title>
+      <para>
+	RESTEasy has a local, server-side, in-memory cache for your JAX-RS services. It automatically caches marshalled responses from HTTP GET JAX-RS invocations if your JAX-RS resource method sets a <literal>Cache-Control</literal> header. When a GET is received, the RESTEasy Server Cache checks whether the URI is stored in the cache. If true, the marshalled response is returned without invoking your JAX-RS method. Each cache entry has a <emphasis>maximum age</emphasis> for which the specifications in the <literal>Cache-Control</literal> header of the initial request are valid. The cache also automatically generates an <literal>ETag</literal> using an MD5 hash on the response body. This lets the client perform HTTP 1.1 cache revalidation with the <literal>IF-NONE-MATCH</literal> header. The cache will also perform revalidation if there is no initial cache hit, but the JAX-RS method returns a body with the same <literal>ETag</literal>.
+      </para>
+      <para>
+	  To set up the server-side cache with Maven, you must use the <literal>resteasy-cache-core</literal> artifact:
+      </para>
+<programlisting>
+&lt;![CDATA[
+&lt;dependency&gt;
+   &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+   &lt;artifactId&gt;resteasy-cache-core&lt;/artifactId&gt;
+   &lt;version&gt;1.1.GA&lt;/version&gt;
+&lt;/dependency&gt;
+]]&gt;
+</programlisting>
+      <para>
+	  Next, add a <literal>ServletContextListener</literal>: <literal>org.jboss.resteasy.plugins.cache.server.ServletServerCache</literal>. You must specify this after the <literal>ResteasyBootstrap</literal> listener in your <filename>web.xml</filename> file.
+      </para>
+<programlisting>
+&lt;![CDATA[
+&lt;web-app&gt;
+    &lt;listener&gt;
+        &lt;listener-class&gt;
+            org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
+        &lt;/listener-class&gt;
+    &lt;/listener&gt;
+
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.server.cache.maxsize&lt;/param-name&gt;
+        &lt;param-value&gt;1000&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.server.cache.eviction.wakeup.interval&lt;/param-name&gt;
+        &lt;param-value&gt;5000&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;listener&gt;
+        &lt;listener-class&gt;
+            org.jboss.resteasy.plugins.cache.server.ServletServerCache
+        &lt;/listener-class&gt;
+    &lt;/listener&gt;
+
+    &lt;servlet&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;servlet-class&gt;
+            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+        &lt;/servlet-class&gt;
+    &lt;/servlet&gt;
+
+    &lt;servlet-mapping&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;url-pattern&gt;/rest-services/*&lt;/url-pattern&gt;
+    &lt;/servlet-mapping&gt;
+
+&lt;/web-app&gt;
+]]&gt;
+</programlisting>
+   <para>
+      The cache implementation is based on the <ulink url="http://jboss.org/jbosscache">JBoss Cache project</ulink>. You can set two <literal>context-param</literal> configuration variables: <literal>resteasy.server.cache.maxsize</literal> sets the number of elements that can be cached, and <literal>resteasy.server.cache.eviction.wakeup.interval</literal> sets the rate at which the background eviction thread runs to purge the cache of stale entries.
+   </para>
+   </section>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Configuring_Individual_JAX-RS_Resource_Beans.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Configuring_Individual_JAX-RS_Resource_Beans.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Configuring_Individual_JAX-RS_Resource_Beans.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,52 @@
+<chapter id="Configuring_Individual_JAX-RS_Resource_Beans">
+<title>Configuring Individual JAX-RS Resource Beans</title>
+
+
+<para>
+  When you scan your path for JAX-RS annotated resource beans, your beans are registered in <emphasis>per-request mode</emphasis>. This means that an instance will be created for every HTTP request served. You will usually require information from your environment. If you run a <filename>WAR</filename> in a Servlet container with Beta 2 or lower, you can only use JNDI lookups to obtain references to Java EE resources and configuration information. In this case, define your EE configuration (that is, <literal>ejb-ref</literal>, <literal>env-entry</literal>, <literal>persistence-context-ref</literal>, etc.) in the <filename>web.xml</filename> of your RESTEasy <filename>WAR</filename> file. Then, within your code, perform JNDI lookups in the <literal>java:comp</literal> namespace. For example:
+</para>
+<para>
+  <filename>web.xml</filename>
+</para>
+<programlisting>
+
+&lt;ejb-ref&gt;
+  &lt;ejb-ref-name&gt;ejb/foo&lt;/ejb-ref-name&gt;
+  ...
+&lt;/ejb-ref&gt;
+
+</programlisting>
+<para>
+  <emphasis>Resource Code:</emphasis>
+</para>
+<programlisting>
+ at Path("/")
+public class MyBean {
+
+   public Object getSomethingFromJndi() {
+      new InitialContext.lookup("java:comp/ejb/foo");
+   }
+...
+}
+</programlisting>
+<para>
+  You can also configure and register your beans manually through the Registry. In a <filename>WAR</filename>-based deployment, you must write a specific <literal>ServletContextListener</literal> to do this. The listener lets you obtain a reference to the Registry, like so:
+</para>
+<programlisting>
+
+public class MyManualConfig implements ServletContextListener
+{
+   public void contextInitialized(ServletContextEvent event)
+   {
+
+      Registry registry = (Registry) event.getServletContext().getAttribute(Registry.class.getName());
+
+   }
+...
+}
+
+</programlisting>
+<para>
+  We recommend investigating Spring Integration and the Embedded Container's Spring Integration for a full understanding of this process.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Content_Marshalling_Providers.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Content_Marshalling_Providers.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Content_Marshalling_Providers.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,271 @@
+<chapter id="Content_Marshalling_Providers">
+   <title>Content Marshalling/Providers</title>
+   <sect1 id="Default_Providers_and_default_JAX-RS_Content_Marshalling">
+      <title>Default Providers and default JAX-RS Content Marshalling</title>
+
+      <para>
+
+         Resteasy can automatically marshal and unmarshal a few different message bodies.
+      </para>
+      <para>
+
+         <table frame="topbot">
+            <tgroup cols="2" rowsep="1" colsep="1">
+               <thead>
+                  <row>
+                     <entry>
+                        Media Types
+                     </entry>
+                     <entry>
+                        Java Type
+                     </entry>
+                  </row>
+               </thead>
+               <tbody>
+                  <row>
+                     <entry>
+                        application/*+xml, text/*+xml, application/*+json, application/*+fastinfoset, application/atom+*
+                     </entry>
+                     <entry>
+                        JaxB annotated classes
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        */*
+                     </entry>
+                     <entry>
+                        java.lang.String
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        */*
+                     </entry>
+                     <entry>
+                        java.io.InputStream
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        text/plain
+                     </entry>
+                     <entry>
+                        primtives, java.lang.String, or any type that has a String constructor, or static
+                        valueOf(String) method for input, toString() for output
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        */*
+                     </entry>
+                     <entry>
+                        javax.activation.DataSource
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        */*
+                     </entry>
+                     <entry>
+                        java.io.File
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        */*
+                     </entry>
+                     <entry>
+                        byte[]
+                     </entry>
+                  </row>
+                  <row>
+                     <entry>
+                        application/x-www-form-urlencoded
+                     </entry>
+                     <entry>
+                        javax.ws.rs.core.MultivaluedMap
+                     </entry>
+                  </row>
+               </tbody>
+            </tgroup>
+         </table>
+
+      </para>
+      <para>
+
+      </para>
+      <para>
+
+      </para>
+      <para>
+
+
+      </para>
+   </sect1>
+   <sect1 id="Content_Marshalling_with__Provider_classes">
+      <title>Content Marshalling with @Provider classes</title>
+
+      <para>
+
+         The JAX-RS specification allows you to plug in your own request/response body reader and writers. To do this,
+         you annotate a class
+         with @Provider and specify the @Produces types for a writer and @Consumes types for a reader. You must
+         also implement
+         a MessageBodyReader/Writer interface respectively. Here is an example.
+      </para>
+      <para>
+
+
+         The Resteasy ServletContextLoader will automatically scan your WEB-INF/lib and classes directories for classes
+         annotated with @Provider or you can manually configure them in web.xml. See Installation/Configuration
+      </para>
+      <para>
+
+
+      </para>
+   </sect1>
+   <sect1 id="MessageBodyWorkers">
+      <title>Providers Utility Class</title>
+
+      <para>
+
+         javax.ws.rs.ext.Providers is a simple injectable interface that allows you to look up MessageBodyReaders,
+          Writers, ContextResolvers, and ExceptionMappers. It is very useful, for instance, for implementing
+          multipart providers. Content types that embed
+         other random content types.
+      </para>
+      <para>
+
+         <programlisting>
+<![CDATA[
+public interface Providers
+{
+
+   /**
+    * Get a message body reader that matches a set of criteria. The set of
+    * readers is first filtered by comparing the supplied value of
+    * {@code mediaType} with the value of each reader's
+    * {@link javax.ws.rs.Consumes}, ensuring the supplied value of
+    * {@code type} is assignable to the generic type of the reader, and
+    * eliminating those that do not match.
+    * The list of matching readers is then ordered with those with the best
+    * matching values of {@link javax.ws.rs.Consumes} (x/y > x&#47;* > *&#47;*)
+    * sorted first. Finally, the
+    * {@link MessageBodyReader#isReadable}
+    * method is called on each reader in order using the supplied criteria and
+    * the first reader that returns {@code true} is selected and returned.
+    *
+    * @param type        the class of object that is to be written.
+    * @param mediaType   the media type of the data that will be read.
+    * @param genericType the type of object to be produced. E.g. if the
+    *                    message body is to be converted into a method parameter, this will be
+    *                    the formal type of the method parameter as returned by
+    *                    <code>Class.getGenericParameterTypes</code>.
+    * @param annotations an array of the annotations on the declaration of the
+    *                    artifact that will be initialized with the produced instance. E.g. if the
+    *                    message body is to be converted into a method parameter, this will be
+    *                    the annotations on that parameter returned by
+    *                    <code>Class.getParameterAnnotations</code>.
+    * @return a MessageBodyReader that matches the supplied criteria or null
+    *         if none is found.
+    */
+   <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type,
+                                                 Type genericType, Annotation annotations[], MediaType mediaType);
+
+   /**
+    * Get a message body writer that matches a set of criteria. The set of
+    * writers is first filtered by comparing the supplied value of
+    * {@code mediaType} with the value of each writer's
+    * {@link javax.ws.rs.Produces}, ensuring the supplied value of
+    * {@code type} is assignable to the generic type of the reader, and
+    * eliminating those that do not match.
+    * The list of matching writers is then ordered with those with the best
+    * matching values of {@link javax.ws.rs.Produces} (x/y > x&#47;* > *&#47;*)
+    * sorted first. Finally, the
+    * {@link MessageBodyWriter#isWriteable}
+    * method is called on each writer in order using the supplied criteria and
+    * the first writer that returns {@code true} is selected and returned.
+    *
+    * @param mediaType   the media type of the data that will be written.
+    * @param type        the class of object that is to be written.
+    * @param genericType the type of object to be written. E.g. if the
+    *                    message body is to be produced from a field, this will be
+    *                    the declared type of the field as returned by
+    *                    <code>Field.getGenericType</code>.
+    * @param annotations an array of the annotations on the declaration of the
+    *                    artifact that will be written. E.g. if the
+    *                    message body is to be produced from a field, this will be
+    *                    the annotations on that field returned by
+    *                    <code>Field.getDeclaredAnnotations</code>.
+    * @return a MessageBodyReader that matches the supplied criteria or null
+    *         if none is found.
+    */
+   <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type,
+                                                 Type genericType, Annotation annotations[], MediaType mediaType);
+
+   /**
+    * Get an exception mapping provider for a particular class of exception.
+    * Returns the provider whose generic type is the nearest superclass of
+    * {@code type}.
+    *
+    * @param type the class of exception
+    * @return an {@link ExceptionMapper} for the supplied type or null if none
+    *         is found.
+    */
+   <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> type);
+
+   /**
+    * Get a context resolver for a particular type of context and media type.
+    * The set of resolvers is first filtered by comparing the supplied value of
+    * {@code mediaType} with the value of each resolver's
+    * {@link javax.ws.rs.Produces}, ensuring the generic type of the context
+    * resolver is assignable to the supplied value of {@code contextType}, and
+    * eliminating those that do not match. If only one resolver matches the
+    * criteria then it is returned. If more than one resolver matches then the
+    * list of matching resolvers is ordered with those with the best
+    * matching values of {@link javax.ws.rs.Produces} (x/y > x&#47;* > *&#47;*)
+    * sorted first. A proxy is returned that delegates calls to
+    * {@link ContextResolver#getContext(java.lang.Class)} to each matching context
+    * resolver in order and returns the first non-null value it obtains or null
+    * if all matching context resolvers return null.
+    *
+    * @param contextType the class of context desired
+    * @param mediaType   the media type of data for which a context is required.
+    * @return a matching context resolver instance or null if no matching
+    *         context providers are found.
+    */
+   <T> ContextResolver<T> getContextResolver(Class<T> contextType,
+                                             MediaType mediaType);
+}
+]]>
+         </programlisting>
+      </para>
+      <para>
+
+
+      </para>
+      <para>
+
+         A Providers instance is injectable into MessageBodyReader or Writers:
+      </para>
+      <para>
+
+         <programlisting>
+            @Provider
+            @Consumes("multipart/fixed")
+            public class MultipartProvider implements MessageBodyReader {
+
+            private @Context Providers providers;
+
+            ...
+
+            }
+         </programlisting>
+      </para>
+      <para>
+
+
+      </para>
+   </sect1>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/ExceptionMappers.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/ExceptionMappers.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/ExceptionMappers.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,124 @@
+<chapter id="ExceptionHandling">
+   <title>Exception Handling</title>
+
+   <section id="ExceptionMappers">
+   <title>Exception Mappers</title>
+   <para>
+
+      <literal>ExceptionMapper</literal>s are custom, application-provided components that can catch application exceptions and write specific HTTP responses. They are associated with <literal>@Provider</literal>, and implement the following interface:
+   </para>
+      <programlisting>
+         package javax.ws.rs.ext;
+
+         import javax.ws.rs.core.Response;
+
+         /**
+         * Contract for a provider that maps Java exceptions to
+         * {@link javax.ws.rs.core.Response}. An implementation of this interface must
+         * be annotated with {@link Provider}.
+         *
+         * @see Provider
+         * @see javax.ws.rs.core.Response
+         */
+         public interface ExceptionMapper&lt;E&gt;
+         {
+
+         /**
+         * Map an exception to a {@link javax.ws.rs.core.Response}.
+         *
+         * @param exception the exception to map to a response
+         * @return a response mapped from the supplied exception
+         */
+         Response toResponse(E exception);
+         }
+      </programlisting>
+   <para>
+      When an application throws an exception, the exception is caught by the JAX-RS runtime. JAX-RS then scans registered <literal>ExceptionMapper</literal>s to locate one which supports marshalling the exception type thrown. An example <literal>ExceptionMapper</literal> follows:
+   </para>
+      <programlisting>
+
+         @Provider
+         public class EJBExceptionMapper implements ExceptionMapper&lt;javax.ejb.EJBException&gt;
+         {
+
+         Response toResponse(EJBException exception) {
+         return Response.status(500).build();
+         }
+
+         }
+      </programlisting>
+   <para>
+      <literal>ExceptionMapper</literal>s are registered in the same way as <literal>MessageBodyReader</literal>s and <literal>MessageBodyWriter</literal>s: by scanning through the RESTEasy provider <literal>context-param</literal> (if you are deploying in a <filename>WAR</filename> file), or programmatically through the <literal>ResteasyProviderFactory</literal> class.
+   </para>
+   </section>
+   <section id="builtinException">
+     <title>RESTEasy Built-in Internally-Thrown Exceptions</title>
+     <para>
+	RESTEasy has a set of built-in exceptions that are thrown when an error is encountered during dispatching or marshalling. Each exception matches a specific HTTP error code. The full list is available in the RESTEasy Java Documentation, under the <literal>org.jboss.resteasy.spi</literal> package. The following table lists the most common exceptions:</para>
+<table frame="topbot"><title>Common Exceptions</title>
+<tgroup cols="3" rowsep="1" colsep="1">
+<thead>
+<row>
+<entry>Exception</entry>
+<entry>HTTP Code</entry>
+<entry>Description</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry><exceptionname>BadRequestException</exceptionname></entry>
+<entry>400</entry>
+<entry>Bad Request. Request was not formatted correctly or there was a problem processing request input.</entry>
+</row>
+<row>
+<entry><exceptionname>UnauthorizedException</exceptionname></entry>
+<entry>401</entry>
+<entry>Unauthorized. Security exception thrown if you use RESTEasy's simple annotation- and  role-based security.</entry>
+</row>
+<row>
+<entry><exceptionname>InternalServerErrorException</exceptionname></entry>
+<entry>500</entry>
+<entry>Internal Server Error.</entry>
+</row>
+<row>
+<entry><exceptionname>MethodNotAllowedException</exceptionname></entry>
+<entry>405</entry>
+<entry>Method Not Allowed. There is no JAX-RS method for the resource that can handle the invoked HTTP operation.</entry>
+</row>
+<row>
+<entry><exceptionname>NotAcceptableException</exceptionname></entry>
+<entry>406</entry>
+<entry>Not Acceptable. There is no JAX-RS method that can produce the media types listed in the Accept header.</entry>
+</row>
+<row>
+<entry><exceptionname>NotFoundException</exceptionname></entry>
+<entry>404</entry>
+<entry>Not Found. There is no JAX-RS method that serves the request path/resource.</entry>
+</row>
+<row>
+<entry><exceptionname>Failure</exceptionname></entry>
+<entry>N/A</entry>
+<entry>Internal RESTEasy. Not logged.</entry>
+</row>
+<row>
+<entry><exceptionname>LoggableFailure</exceptionname></entry>
+<entry>N/A</entry>
+<entry>Internal RESTEasy error. Logged.</entry>
+</row>
+<row>
+<entry><exceptionname>DefaultOptionsMethodException</exceptionname></entry>
+<entry>N/A</entry>
+<entry>If the user invokes HTTP OPTIONS without a JAX-RS method, RESTEasy provides a default behavior by throwing this exception.</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+</section>
+<section id="overring_resteasy_exceptions">
+   <title>Overriding Resteasy Builtin Exceptions</title>
+   <para>
+      You can override RESTEasy built-in exceptions by writing an <literal>ExceptionMapper</literal> for the exception. You can also write an <literal>ExceptionMapper</literal> for any exception thrown, including <literal>WebApplicationException</literal>.
+  </para>
+</section>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Guice1.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Guice1.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Guice1.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,68 @@
+<chapter id="Guice1">
+    <title>Guice 1.0 Integration</title>
+    <para>
+	RESTEasy does have some basic integration with Guice 1.0. RESTEasy scans a Guice Module's binding types for <literal>@Path</literal> and <literal>@Provider</literal> annotations, and registers these bindings. The <literal>guice-hello</literal> project that comes in the RESTEasy <filename>examples/</filename> directory gives a nice example of this.
+    </para>
+<programlisting>
+ at Path("hello")
+public class HelloResource
+{
+   @GET
+   @Path("{name}")
+   public String hello(@PathParam("name") final String name) {
+      return "Hello " + name;
+   }
+}
+</programlisting>
+    <para>
+	Start by specifying a JAX-RS resource class &#8212; in this case, the <literal>HelloResource</literal>. Next, create a Guice Module class that defines your bindings:
+    </para>
+<programlisting>
+import com.google.inject.Module;
+import com.google.inject.Binder;
+
+public class HelloModule implements Module
+{
+    public void configure(final Binder binder)
+    {
+       binder.bind(HelloResource.class);
+    }
+}
+</programlisting>
+    <para>
+	Place these classes within your <filename>WAR WEB-INF/classes</filename> or in a <filename>JAR</filename> within <filename>WEB-INF/lib</filename>. Then, create your <filename>web.xml</filename> file. You will need to use the <literal>GuiceResteasyBootstrapServletContextListener</literal> like so:
+    </para>
+<programlisting>
+&lt;![CDATA[
+&lt;web-app&gt;
+    &lt;display-name&gt;Guice Hello&lt;/display-name&gt;
+
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.guice.modules&lt;/param-name&gt;
+        &lt;param-value&gt;org.jboss.resteasy.examples.guice.hello.HelloModule&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;listener&gt;
+        &lt;listener-class&gt;
+            org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener
+        &lt;/listener-class&gt;
+    &lt;/listener&gt;
+
+    &lt;servlet&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;servlet-class&gt;
+            org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+        &lt;/servlet-class&gt;
+    &lt;/servlet&gt;
+
+    &lt;servlet-mapping&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+    &lt;/servlet-mapping&gt;
+
+&lt;/web-app&gt;
+]]&gt;
+</programlisting>
+    <para>
+	<literal>GuiceResteasyBootstrapServletContextListener</literal> is a subclass of <literal>ResteasyBootstrap</literal>, so you can use any other RESTEasy configuration option within your <filename>web.xml</filename> file. Also note the <literal>resteasy.guice.modules</literal> context parameter. This can take a comma delimited list of class names that are Guice Modules.</para>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Installation_Configuration.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Installation_Configuration.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Installation_Configuration.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,323 @@
+<chapter id="Installation_Configuration">
+<title>Installation/Configuration</title>
+
+
+<para>
+  RESTEasy is deployed as a <filename>WAR</filename> archive, so it must be deployed inside a Servlet container.
+</para>
+
+<para>
+  Download and unzip the RESTEasy package from <ulink url="http://sourceforge.net/projects/resteasy/files/">SourceForge</ulink>. The unzipped package contains an exploded <filename>WAR</filename>. Make a deep copy of the <filename>WAR</filename> archive for use with your particular application.
+</para>
+<para>
+  Place your JAX-RS annotated class resources and providers in one or more <filename>JAR</filename>s within <literal>/WEB-INF/lib</literal>. Alternatively, place your raw class files within <literal>/WEB-INF/classes</literal>. By default, RESTEasy is configured to scan <filename>JAR</filename>s and classes within these directories for JAX-RS annotated classes, and to deploy and register them within the system.
+</para>
+<para>
+
+
+RESTEasy is implemented as a <literal>ServletContextListener</literal> and a Servlet, and deployed within a <filename>WAR</filename> file. The <filename>WEB-INF/web.xml</filename> file contains the following:
+</para>
+<para>
+
+<programlisting>
+    &lt;![CDATA[
+&lt;web-app&gt;
+    &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
+    &lt;!-- Set this if you want Resteasy to scan for JAX-RS classes
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.scan&lt;/param-name&gt;
+        &lt;param-value&gt;true&lt;/param-value&gt;
+    &lt;/context-param&gt;
+    --&gt;
+
+    &lt;!-- set this if you map the Resteasy servlet to something other than /*
+    &lt;context-param&gt;
+       &lt;param-name&gt;resteasy.servlet.mapping.prefix&lt;/param-name&gt;
+       &lt;param-value&gt;/resteasy&lt;/param-value&gt;
+    &lt;/context-param&gt;
+    --&gt;
+    &lt;!-- to turn on security
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.role.based.security&lt;/param-name&gt;
+        &lt;param-value&gt;true&lt;/param-value&gt;
+    &lt;/context-param&gt;
+     --&gt;
+
+    &lt;listener&gt;
+        &lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
+    &lt;/listener&gt;
+
+    &lt;servlet&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
+    &lt;/servlet&gt;
+
+    &lt;servlet-mapping&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+    &lt;/servlet-mapping&gt;
+&lt;/web-app&gt;
+]]&gt;
+</programlisting>
+</para>
+<para>
+The <literal>ResteasyBootstrap</literal> listener initializes some of RESTEasy's basic components and scans for annotation classes that exist in your <filename>WAR</filename> file. It also receives configuration options from <literal>&lt;context-param&gt;</literal> elements.
+</para>
+
+<para>
+  These configuration options must be set if your <literal>servlet-mapping</literal> for the RESTEasy Servlet has a URL pattern other than <literal>/*</literal>. For example, if the URL pattern is:
+</para>
+<programlisting>
+   &lt;servlet-mapping&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;url-pattern&gt;/restful-services/*&lt;/url-pattern&gt;
+   &lt;/servlet-mapping&gt;
+</programlisting>
+<para>
+  Then the value of <literal>resteasy-servlet.mapping.prefix</literal> must be:
+</para>
+<programlisting>
+
+   &lt;context-param&gt;
+      &lt;param-name&gt;resteasy.servlet.mapping.prefix&lt;/param-name&gt;
+      &lt;param-value&gt;/restful-services&lt;/param-value&gt;
+   &lt;/context-param&gt;
+</programlisting>
+<para>
+  The available options are outlined in the table following.
+</para>
+<table frame="topbot"><title>Servlet Mapping Prefix Options</title>
+<tgroup cols='3' rowsep='1' colsep='1'>
+ <thead>
+<row>
+<entry>Option Name</entry>
+<entry>Default Value</entry>
+<entry>Description</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry>
+<literal>resteasy.servlet.mapping.prefix</literal></entry>
+<entry>
+no default</entry>
+<entry>
+Defines the URL pattern for the RESTEasy <literal>servlet-mapping</literal>, if not <literal>/*.</literal></entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.scan.providers</literal></entry>
+<entry>
+false</entry>
+<entry>
+Scans for <literal>@Provider</literal> classes and registers them.</entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.scan.resources</literal></entry>
+<entry>
+false</entry>
+<entry>
+Scans for JAX-RS resource classes.</entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.scan</literal></entry>
+<entry>
+false</entry>
+<entry>
+Scans for both <literal>@Provider</literal> and JAX-RS resource classes (<literal>@Path</literal>, <literal>@GET</literal>, <literal>@POST</literal>, etc.) and registers them.</entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.providers</literal></entry>
+<entry>
+no default</entry>
+<entry>
+A comma-delimited list of fully-qualified <literal>@Provider</literal> class names you want to register.</entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.use.builtin.providers</literal></entry>
+<entry>
+true</entry>
+<entry>
+Determines whether default, built-in <literal>@Provider</literal> classes are registered. This option is available only in version 1.0-beta-5 and later.</entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.resources</literal></entry>
+<entry>
+no default</entry>
+<entry>
+A comma-delimited list of fully-qualified JAX-RS resource class names you want to register.</entry>
+</row>
+<row>
+<entry>
+<literal>resteasy.jndi.resources</literal></entry>
+<entry>
+no default</entry>
+<entry>
+A comma-delimited list of JNDI names referencing the objects that you want to register as JAX-RS resources.</entry>
+</row>
+<row>
+<entry>
+<literal>javax.ws.rs.core.Application</literal></entry>
+<entry>
+no default</entry>
+<entry>
+Fully-qualified name of the Application class to bootstrap in a spec portable way</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+  The <literal>ResteasyBootstrap</literal> listener configures an instance of the <literal>ResteasyProviderFactory</literal> and <literal>Registry</literal>. You can obtain  <literal>ResteasyProviderFactory</literal> and <literal>Registry</literal> instances from the <literal>ServletContext</literal> attributes <literal>org.jboss.resteasy.spi.ResteasyProviderFactory</literal> and <literal>org.jboss.resteasy.spi.Registry</literal>.
+</para>
+
+<section id="javax.ws.rs.core.Application">
+<title>javax.ws.rs.core.Application</title>
+
+<para>
+  <literal>javax.ws.rs.core.Application</literal> is a standard JAX-RS class that can be implemented to provide information about your deployment. It is a class that lists all JAX-RS root resources and providers.
+</para>
+
+<programlisting>
+/**
+ * Defines the components of a JAX-RS application and supplies additional
+ * metadata. A JAX-RS application or implementation supplies a concrete
+ * subclass of this abstract class.
+ */
+public abstract class Application
+{
+   private static final Set&lt;Object&gt; emptySet = Collections.emptySet();
+
+   /**
+    * Get a set of root resource and provider classes. The default lifecycle
+    * for resource class instances is per-request. The default lifecycle for
+    * providers is singleton.
+    * &lt;p/&gt;
+    * &lt;p&gt;Implementations should warn about and ignore classes that do not
+    * conform to the requirements of root resource or provider classes.
+    * Implementations should warn about and ignore classes for which
+    * {@link #getSingletons()} returns an instance. Implementations MUST
+    * NOT modify the returned set.&lt;/p&gt;
+    *
+    * @return a set of root resource and provider classes. Returning null
+    *         is equivalent to returning an empty set.
+    */
+   public abstract Set&lt;Class&lt;?&gt;&gt; getClasses();
+
+   /**
+    * Get a set of root resource and provider instances. Fields and properties
+    * of returned instances are injected with their declared dependencies
+    * (see {@link Context}) by the runtime prior to use.
+    * &lt;p/&gt;
+    * &lt;p&gt;Implementations should warn about and ignore classes that do not
+    * conform to the requirements of root resource or provider classes.
+    * Implementations should flag an error if the returned set includes
+    * more than one instance of the same class. Implementations MUST
+    * NOT modify the returned set.&lt;/p&gt;
+    * &lt;p/&gt;
+    * &lt;p&gt;The default implementation returns an empty set.&lt;/p&gt;
+    *
+    * @return a set of root resource and provider instances. Returning null
+    *         is equivalent to returning an empty set.
+    */
+   public Set&lt;Object&gt; getSingletons()
+   {
+      return emptySet;
+   }
+
+}
+</programlisting>
+
+<para>
+
+To use Application you must set the Servlet <literal>context-param</literal>, <literal>javax.ws.rs.core.Application</literal>, with a fully-qualified class that implements Application. For example:
+</para>
+<para>
+
+<programlisting>
+
+   &lt;context-param&gt;
+      &lt;param-name&gt;javax.ws.rs.core.Application&lt;/param-name&gt;
+      &lt;param-value&gt;com.mycom.MyApplicationConfig&lt;/param-value&gt;
+   &lt;/context-param&gt;
+
+
+
+</programlisting>
+</para>
+<para>
+
+If you have this set, you should probably turn off automatic scanning as this will probably result in duplicate classes being registered.</para>
+<para>
+
+
+</para>
+</section>
+<section id="RESTEasyLogging">
+<title>RESTEasyLogging</title>
+
+<para>
+  RESTEasy logs various events using  <application>slf4j</application>.
+</para>
+<para>
+  The slf4j API is intended to serve as a simple facade for various logging APIs, allowing you to plug in the desired implementation at deployment time. By default, RESTEasy is configured to use <application>Apache log4j</application>, but you can use any logging provider supported by slf4j. 
+</para>
+<para>
+  The initial set of logging categories defined in the framework is listed below. Further logging categories are being added, but these should make it easier to troubleshoot issues.
+</para>
+
+<table frame="topbot"><title>Logging Categories</title>
+<tgroup cols='2' rowsep='1' colsep='1'>
+<thead>
+<row>
+<entry>
+Category</entry>
+<entry>
+ Function</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry><literal>org.jboss.resteasy.core</literal></entry>
+<entry>
+Logs all activity by the core RESTEasy implementation.</entry>
+</row>
+<row>
+<entry>
+<literal>org.jboss.resteasy.plugins.providers</literal></entry>
+<entry>
+Logs all activity by RESTEasy entity providers.</entry>
+</row>
+<row>
+<entry>
+<literal>org.jboss.resteasy.plugins.server</literal></entry>
+<entry>
+Logs all activity by the RESTEasy server implementation.</entry>
+</row>
+<row>
+<entry>
+<literal>org.jboss.resteasy.specimpl</literal></entry>
+<entry>
+Logs all activity by JAX-RS implementing classes.</entry>
+</row>
+<row>
+<entry>
+<literal>org.jboss.resteasy.mock</literal></entry>
+<entry>
+Logs all activity by the RESTEasy mock framework.</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+  If you are developing RESTEasy code, the <literal>LoggerCategories</literal> class provides easy access to category names and the various loggers. 
+</para>
+</section>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Interceptors.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Interceptors.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Interceptors.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,364 @@
+<chapter id="Interceptors">
+    <title>Interceptors</title>
+    <para>
+    RESTEasy can intercept JAX-RS invocations and route them through listener-like objects called <emphasis>interceptors</emphasis>. There are four interception points on the server side:
+    </para>
+    <itemizedlist>
+      <listitem>
+    <para>
+      wrapping around <literal>MessageBodyWriter</literal> invocations
+    </para>
+      </listitem>
+      <listitem>
+    <para>
+      wrapping around <literal>MessageBodyReader</literal> invocations
+    </para>
+      </listitem>
+      <listitem>
+    <para>
+      through <emphasis>pre-processors</emphasis>, which intercept the incoming request before unmarshalling occurs
+    </para>
+      </listitem>
+      <listitem>
+    <para>
+      through <emphasis>post-processors</emphasis>, which are invoked immediately after the JAX-RS method finishes
+    </para>
+      </listitem>
+    </itemizedlist>
+    <para>
+    You can also intercept <literal>MessageBodyReader</literal>, <literal>MessageBodyWriter</literal>, and the remote invocation to the server on the client side.
+    </para>
+    <section id="MessageBodyInterceptors">
+       <title>MessageBodyReader/Writer Interceptors</title>
+        <para>
+        <literal>MessageBodyReader</literal> and <literal>MessageBodyWriter</literal> interceptors wrap around the invocation of <literal>MessageBodyReader.readFrom()</literal> or <literal>MessageBodyWriter.writeTo()</literal>. They are used to wrap the <literal>Output</literal> or <literal>InputStream</literal>. For example, RESTEasy GZIP support contains interceptors that create and override the default <literal>Output</literal> and <literal>InputStream</literal> with a <literal>GzipOutputStream</literal> or <literal>GzipInputStream</literal> so that GZIP encoding can work. You can also use interceptors to append headers to the response (or, on the client side, the outgoing request).</para>
+        <para>
+        To use an interceptor, implement the <literal>org.jbos.resteasy.spi.interception.MessageBodyReaderInterceptor</literal> or <literal>MessageBodyWriterInterceptor</literal>.
+    </para>
+<programlisting>
+&lt;![CDATA[
+public interface MessageBodyReaderInterceptor
+{
+   Object read(MessageBodyReaderContext context) throws IOException, WebApplicationException;
+
+}
+
+public interface MessageBodyWriterInterceptor
+{
+   void write(MessageBodyWriterContext context) throws IOException, WebApplicationException;
+
+}
+
+        ]]&gt;
+</programlisting>
+        <para>
+        Interceptors are driven by the <literal>MessageBodyWriterContext</literal> or <literal>MessageBodyReaderContext</literal>. They are invoked together in a Java call stack. You must call <literal>MessageBodyReaderContext.proceed()</literal> or <literal>MessageBodyWriterContext.proceed()</literal> to add subsequent interceptors. When there are no more interceptors to invoke, call the <literal>readFrom()</literal> or <literal>writeTo()</literal> method of the <literal>MessageBodyReader</literal> or <literal>MessageBodyWriter</literal>. This wrapping lets you modify objects before they reach the Reader or Writer, and clean up when <literal>proceed()</literal> returns. The <literal>Context</literal> objects also posess methods that modify the parameters sent to the Reader or Writer.
+        </para>
+<programlisting>
+&lt;![CDATA[
+public interface MessageBodyReaderContext
+{
+   Class getType();
+
+   void setType(Class type);
+
+   Type getGenericType();
+
+   void setGenericType(Type genericType);
+
+   Annotation[] getAnnotations();
+
+   void setAnnotations(Annotation[] annotations);
+
+   MediaType getMediaType();
+
+   void setMediaType(MediaType mediaType);
+
+   MultivaluedMap&lt;String, String&gt; getHeaders();
+
+   InputStream getInputStream();
+
+   void setInputStream(InputStream is);
+
+   Object proceed() throws IOException, WebApplicationException;
+}
+
+public interface MessageBodyWriterContext
+{
+   Object getEntity();
+
+   void setEntity(Object entity);
+
+   Class getType();
+
+   void setType(Class type);
+
+   Type getGenericType();
+
+   void setGenericType(Type genericType);
+
+   Annotation[] getAnnotations();
+
+   void setAnnotations(Annotation[] annotations);
+
+   MediaType getMediaType();
+
+   void setMediaType(MediaType mediaType);
+
+   MultivaluedMap&lt;String, Object&gt; getHeaders();
+
+   OutputStream getOutputStream();
+
+   public void setOutputStream(OutputStream os);
+
+   void proceed() throws IOException, WebApplicationException;
+}
+]]&gt;
+</programlisting>
+        <para>
+        <literal>MessageBodyReaderInterceptor</literal>s and <literal>MessageBodyWriterInterceptor</literal>s can be use on the server or the client side. They must be annotated with <literal>@org.jboss.resteasy.annotations.interception.ServerInterceptor</literal> or <literal>@org.jboss.resteasy.annotations.interception.ClientInterceptor</literal> so that RESTEasy adds them to the correct interceptor list. If your interceptor classes are not annotated with one or both of these annotations, a deployment error will occur. Interceptors should also be annotated with <literal>@Provider</literal>, like so:
+        </para>
+<programlisting>
+ at Provider
+ at ServerInterceptor
+public class MyHeaderDecorator implements MessageBodyWriterInterceptor {
+
+    public void write(MessageBodyWriterContext context) throws IOException, WebApplicationException
+    {
+       context.getHeaders().add("My-Header", "custom");
+       context.proceed();
+    }
+}
+</programlisting>
+        <para>
+        This is a server-side interceptor that adds a header value to the response. It is annotated with <literal>@Provider</literal> and <literal>@ServerInterceptor</literal>. It must modify the header before calling <literal>context.proceed()</literal>, because the response may be committed after the <literal>MessageBodyReader</literal> runs.
+    </para>
+    <important>
+      <para>
+        You must call <literal>context.proceed()</literal>, or your invocation will not occur.
+      </para>
+    </important>
+    </section>
+    <section id="PreProcessInterceptors">
+        <title>PreProcessInterceptor</title>
+        <para>
+        The <literal>org.jboss.resteasy.spi.interception.PreProcessInterceptor</literal> runs after a JAX-RS resource method is located, but before the method is invoked. They can only be used on the server, but you must still annotate them with <literal>@ServerInterceptor</literal>. They can be used to implement security features or to preempt the Java request. The RESTEasy security implementation uses these interceptors to abort requests prior to invocation if the user does not pass authorization. The RESTEasy caching framework uses them to return cached responses, to avoid invoking methods multiple times. The interceptor interface is as follows:
+    </para>
+<programlisting>
+    public interface PreProcessInterceptor
+    {
+       ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException;
+    }
+
+</programlisting>
+        <para>
+        <literal>PreProcessInterceptor</literal>s run in sequence and do not wrap the actual JAX-RS invocation. To illustrate:
+    </para>
+<programlisting>
+    for (PreProcessInterceptor interceptor : preProcessInterceptors) {
+       ServerResponse response = interceptor.preProcess(request, method);
+       if (response != null) return response;
+    }
+    executeJaxrsMethod(...);
+</programlisting>
+        <para>
+        If the <literal>preProcess()</literal> method returns a <literal>ServerResponse</literal> then the underlying JAX-RS method will not be invoked and the runtime will process the response and return to the client.</para>
+    </section>
+    <section id="PostProcessInterceptors">
+        <title>PostProcessInterceptors</title>
+        <para>
+          The <literal>org.jboss.resteasy.spi.interception.PostProcessInterceptor</literal> runs after the JAX-RS method is invoked but before <literal>MessageBodyWriter</literal>s are invoked. They can only be used on the server side, and exist to provide symmetry with <literal>PreProcessInterceptor</literal>. They are used to set response headers when there is a possibility that no <literal>MessageBodyWriter</literal> will be invoked. They do not wrap any object, and are invoked in order, like <literal>PreProcessInterceptor</literal>s.
+        </para>
+<programlisting>
+    public interface PostProcessInterceptor
+    {
+       void postProcess(ServerResponse response);
+    }
+    
+</programlisting>
+
+    </section>
+    <section id="ClientExecutionInterceptors">
+        <title>ClientExecutionInterceptors</title>
+        <para>
+        <literal>org.jboss.resteasy.spi.interception.ClientExecutionInterceptor</literal> classes are client-side only. They run after the <literal>MessageBodyWriter</literal>, and after the <literal>ClientRequest</literal> has been built on the client side. They wrap the HTTP invocation that is sent to the server. In RESTEasy GZIP support, they set the <literal>Accept</literal> header to contain <literal>gzip, deflate</literal> before the request is sent. In the RESTEasy client cache, they check that the cache contains a resource before attempting to act on a resource. These interceptors must be annotated with both <literal>@ClientInterceptor</literal> and <literal>@Provider</literal>.
+    </para>
+<programlisting>
+    public interface ClientExecutionInterceptor
+    {
+       ClientResponse execute(ClientExecutionContext ctx) throws Exception;
+    }
+
+    public interface ClientExecutionContext
+    {
+       ClientRequest getRequest();
+
+       ClientResponse proceed() throws Exception;
+    }
+    
+</programlisting>
+        <para>
+        They work similarly to <literal>MessageBodyReader</literal> in that you must call <literal>proceed()</literal> or the invocation will be aborted.
+    </para>
+    </section>
+    <section id="BindingInterceptors">
+        <title>Binding Interceptors</title>
+        <para>
+        By default, any registered interceptor will be invoked for every request. You can alter this by having your interceptors implement the <literal>org.jboss.resteasy.spi.AcceptedByMethod</literal> interface:</para>
+<programlisting>
+    public interface AcceptedByMethod
+    {
+       public boolean accept(Class declaring, Method method);
+    }
+
+</programlisting>
+        <para>
+        If your interceptor implements this interface, RESTEasy invokes the <literal>accept()</literal> method. If this method returns <literal>true</literal>, RESTEasy adds that interceptor to the JAX-RS method's call chain. If it returns <literal>false</literal>, the interceptor will not be added to the call chain. For example:
+    </para>
+<programlisting>
+ at Provider
+ at ServerInterceptor
+public class MyHeaderDecorator implements MessageBodyWriterInterceptor, AcceptedByMethod {
+
+    public boolean accept(Class declaring, Method method) {
+       return method.isAnnotationPresent(GET.class);
+    }
+
+   public void write(MessageBodyWriterContext context) throws IOException, WebApplicationException
+   {
+      context.getHeaders().add("My-Header", "custom");
+      context.proceed();
+   }
+}
+        </programlisting>
+        <para>
+        In this example, the <literal>accept()</literal> method checks whether the <literal>@GET</literal> annotation exists in the JAX-RS method. If it does, the interceptor will be applied to that method's call chain.
+    </para>
+
+    </section>
+    <section id="registering">
+         <title>Registering Interceptors</title>
+        <para>
+        When your interceptors are annotated as <literal>@Provider</literal>s, they can be listed in the <literal>resteasy.providers context-param</literal> in <filename>web.xml</filename>, or returned as a class or object in the <literal>Application.getClasses()</literal> or <literal>Application.getSingletons()</literal> method.</para>
+    </section>
+    <section id="interceptorPrecedence">
+        <title>Interceptor Ordering and Precedence</title>
+        <para>
+        Some interceptors are sensitive to the order in which they are invoked. For example, your security interceptor should always be invoked first. Other interceptors' behavior can be triggered by an interceptor that adds a header. By default, you have no control over the order in which registered interceptors are invoked, but you can specify interceptor <emphasis>precedence</emphasis>.
+    </para>
+        <para>
+        Interceptor precedence is not specified by listing interceptor classes. Instead, a particular interceptor class is associated with a <emphasis>precedence family</emphasis> with the <literal>@org.jboss.resteasy.annotations.interception.Precedence</literal> annotation. Specifying precedence through a family structure protects the built-in interceptors that are sensitive to ordering and simplifies configuration.
+    </para>
+        <para>
+        The families are listed here in execution order:
+    </para>
+<programlisting>
+    SECURITY
+    HEADER_DECORATOR
+    ENCODER
+    REDIRECT
+    DECODER
+</programlisting>
+        <para>
+        Any interceptor not associated with a precedence family will be invoked last. <literal>SECURITY</literal> usually includes <literal>PreProcessInterceptor</literal>s. These should be invoked first so that as little as possible occurs prior to authorization. <literal>HEADER_DECORATOR</literal>s are interceptors that add headers to a response or an outgoing request. These are next in precedence because the added headers may affect the behavior of other interceptors. <literal>ENCODER</literal> interceptors change the <literal>OutputStream</literal>. For example, the GZIP interceptor creates a <literal>GZIPOutputStream</literal> to wrap the real <literal>OutputStream</literal> for compression. <literal>REDIRECT</literal> interceptors are usually used in <literal>PreProcessInterceptor</literal>s because they can reroute the request and bypass the JAX-RS method. <literal>DECODER</literal> interceptors wrap the <literal>InputStream</literal>.  For example, the GZIP intercep!
 tor decoder wraps the <literal>InputStream</literal> in a <literal>GzipInputStream</literal> instance.
+    </para>
+        <para>
+        To associate your custom interceptors with a particular family, annotate it with <literal>@org.jboss.resteasy.annotations.interception.Precendence annotation</literal>.</para>
+<programlisting>
+ at Provider
+ at ServerInterceptor
+ at ClientInterceptor
+ at Precedence("ENCODER")
+public class MyCompressionInterceptor implements MessageBodyWriterInterceptor {...}
+</programlisting>
+        <para>
+        There are convenience annotations in the <literal>org.jboss.resteasy.annotations.interception</literal> package to provide complete type safety: <literal>@DecoredPrecedence</literal>, <literal>@EncoderPrecedence</literal>, <literal>@HeaderDecoratorPrecedence</literal>, <literal>@RedirectPrecedence</literal>, and <literal>@SecurityPrecedence</literal>. Use these instead of the <literal>@Precedence</literal> annotation</para>
+        <section id="customprecedence">
+            <title>Custom Precedence</title>
+            <para>
+          You can define your own precedence families and apply them with the <literal>@Precedence</literal> annotation.
+        </para>
+ <programlisting>
+ @Provider
+ @ServerInterceptor
+ @Precedence("MY_CUSTOM_PRECEDENCE")
+ public class MyCustomInterceptor implements MessageBodyWriterInterceptor {...}
+            </programlisting>
+            <para>
+          You can create your own convenience annotation by using <literal>@Precedence</literal> as a meta-annotation.
+        </para>
+<programlisting>
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+ at Precedence("MY_CUSTOM_PRECEDENCE")
+public @interface MyCustomPrecedence {}
+</programlisting>
+            <para>
+        You must register your custom precedence, or RESTEasy will show an error at deployment time. You can register your custom precendence with the context parameters:
+        </para>
+<programlisting>
+resteasy.append.interceptor.precedence
+resteasy.interceptor.before.precedence
+resteasy.interceptor.after.precedence</programlisting>
+            <para>
+        <literal>resteasy.append.interceptor.precedence</literal> appends the precedence family to the list. <literal>resteasy.interceptor.before.precedence</literal> lets you specify a family for your precendence to fall ahead of. <literal>resteasy.interceptor.after.precedence</literal> lets you specify a family for your precedence to follow after. For example:</para>
+<programlisting>
+&lt;![CDATA[
+web-app&gt;
+    &lt;display-name&gt;Archetype RestEasy Web Application&lt;/display-name&gt;
+
+    &lt;!-- testing configuration --&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.append.interceptor.precedence&lt;/param-name&gt;
+        &lt;param-value&gt;END&lt;/param-value&gt;
+    &lt;/context-param&gt;
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.interceptor.before.precedence&lt;/param-name&gt;
+        &lt;param-value&gt;ENCODER : BEFORE_ENCODER&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.interceptor.after.precedence&lt;/param-name&gt;
+        &lt;param-value&gt;ENCODER : AFTER_ENCODER&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;context-param&gt;
+        &lt;param-name&gt;resteasy.servlet.mapping.prefix&lt;/param-name&gt;
+        &lt;param-value&gt;/test&lt;/param-value&gt;
+    &lt;/context-param&gt;
+
+    &lt;listener&gt;
+        &lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
+    &lt;/listener&gt;
+
+    &lt;servlet&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
+    &lt;/servlet&gt;
+
+    &lt;servlet-mapping&gt;
+        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+        &lt;url-pattern&gt;/test/*&lt;/url-pattern&gt;
+    &lt;/servlet-mapping&gt;
+
+&lt;/web-app&gt;
+        
+]]&gt;
+</programlisting>
+            <para>
+        In this <filename>web.xml</filename> file, we have defined three new precedence families: <literal>END</literal>, <literal>BEFORE_ENCODER</literal>, and <literal>AFTER_ENCODER</literal>. With this configuration, the family order would look like this:
+        </para>
+<programlisting>
+SECURITY
+HEADER_DECORATOR
+BEFORE_ENCODER
+ENCODER
+AFTER_ENCODER
+REDIRECT
+DECODER
+END
+</programlisting>
+        </section>
+    </section>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Content_Negotiation.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Content_Negotiation.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Content_Negotiation.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,91 @@
+<chapter id="JAX-RS_Content_Negotiation">
+   <title>JAX-RS Content Negotiation</title>
+
+   <para>
+
+      The HTTP protocol has built-in content negotiation headers that allow the client and server to specify the type of content that they transfer, and the type of content they prefer to receive. The server declares content preferences via the <literal>@Produces</literal> and <literal>@Consumes</literal> headers.
+   </para>
+   <para>
+      <literal>@Consumes</literal> is an array of media types that a particular resource or resource method consumes. For example:
+   </para>
+   <para>
+
+      <programlisting>
+         @Consumes("text/*")
+         @Path("/library")
+         public class Library {
+
+         @POST
+         public String stringBook(String book) {...}
+
+
+         @Consumes("text/xml")
+         @POST
+         public String jaxbBook(Book book) {...}
+      </programlisting>
+   </para>
+   <para>
+
+      When a client makes a request, JAX-RS first locates all methods that match the path. It then sorts objects based on the content-type header sent by the client. If a client sends the following:
+   </para>
+   <programlisting>
+         POST /library
+         content-type: text/plain
+
+         this is a nice book
+      </programlisting>
+   <para>
+      The <literal>stringBook()</literal> method is invoked, because it matches the default <literal>text/*</literal> media type. If the client sends XML, like so:
+   </para>
+
+      <programlisting>
+         POST /library
+         content-type: text/xml
+
+         &lt;book name="EJB 3.0" author="Bill Burke"/&gt;
+      </programlisting>
+
+   <para>
+
+      Then the <literal>jaxbBook()</literal> method is invoked.
+   </para>
+   <para>
+      <literal>@Produces</literal> is used to map a client request and match it with the client's <literal>Accept</literal> header. The <emphasis>Accept HTTP</emphasis>
+      header is sent by the client, and defines the media types that the client prefers to receive from the server.
+   </para>
+      <programlisting>
+         @Produces("text/*")
+         @Path("/library")
+         public class Library {
+
+         @GET
+         @Produces("application/json")
+         public String getJSON() {...}
+
+
+         @GET
+         public String get() {...}
+      </programlisting>
+   
+   <para>
+      So, if the client sends:
+   </para>
+
+      <programlisting>
+      
+         GET /library
+         Accept: application/json
+      </programlisting>
+
+   <para>
+
+      The <literal>getJSON()</literal> method would be invoked.
+   </para>
+   <para>
+      <literal>@Consumes</literal> and <literal>@Produces</literal> can support multiple media types by presenting them in a list. The client's <literal>Accept</literal> header can also list multiple media types to receive. More specific media types are selected first. The <literal>Accept</literal> header (or <literal>@Produces</literal> or <literal>@Consumes</literal>) can also specify weighted preferences that will match requests with resource methods. (This is best explained in Section 14.1 of RFC 2616.) RESTEasy provides support for this more complex method of content negotiation.
+   </para>
+
+   <para>
+      An alternative method used by JAX-RS is a combination of media-type, content-language, and content encoding, in addition to etags, last modified headers, and other pre-condititions. This is a more complex form of content negotiation, performed programmatically by the application developer via the <literal>javax.ws.rs.Variant</literal>, <literal>VarianListBuilder</literal>, and <literal>Request</literal> objects. <literal>Request</literal> is injected using the <literal>@Context</literal> annotation. (For more information, read the JavaDoc.)
+   </para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Resource_Locators_and_Sub_Resources.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Resource_Locators_and_Sub_Resources.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/JAX-RS_Resource_Locators_and_Sub_Resources.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,108 @@
+<chapter id="JAX-RS_Resource_Locators_and_Sub_Resources">
+<title>JAX-RS Resource Locators and Sub Resources</title>
+
+<para>
+  Resource classes can partially process a request and then provide another <emphasis>sub-resource</emphasis> object to process the remainder of the request. For example:
+</para>
+<programlisting>
+ at Path("/")
+public class ShoppingStore {
+
+   @Path("/customers/{id}")
+   public Customer getCustomer(@PathParam("id") int id) {
+      Customer cust = ...; // Find a customer object
+      return cust;
+   }
+}
+
+
+public class Customer {
+   
+    @GET
+    public String get() {...}
+
+    @Path("/address")
+    public String getAddress() {...}
+
+}
+
+</programlisting>
+<para>
+  Resource methods with a <literal>@Path</literal> annotation and no HTTP method are considered <emphasis>sub-resource locators</emphasis>. They provide an object that can process the request. In the previous example code,  <literal>ShoppingStore</literal> is a root resource because its class is annotated with <literal>@Path</literal>. The <literal>getCustomer()</literal> is a sub-resource locator method.
+</para>
+<para>
+  If the client invoked the following:
+</para>
+<programlisting>GET /customer/123</programlisting>
+<para>
+  Then the <literal>ShoppingStore.getCustomer()</literal> method would be invoked first. This method provides a <literal>Customer</literal> object that can service the request. The HTTP request will be dispatched to the <literal>Customer.get()</literal> method. Another example is:
+</para>
+<programlisting>GET /customer/123/address</programlisting>
+<para>
+  In this request, again, first the <literal>ShoppingStore.getCustomer()</literal> method is invoked.  A <literal>Customer</literal> object is returned, and the rest of the request is dispatched to the <literal>Customer.getAddress()</literal> method.
+</para>
+<para>
+  Another interesting feature of sub-resource locators is that the locator method result is dynamically processed at runtime in order to determine how the request should be dispatched. This means that the <literal>ShoppingStore.getCustomer()</literal> method does not have to declare any specific type.
+</para>
+
+<programlisting>
+ at Path("/")
+public class ShoppingStore {
+
+   @Path("/customers/{id}")
+   public java.lang.Object getCustomer(@PathParam("id") int id) {
+      Customer cust = ...; // Find a customer object
+      return cust;
+   }
+}
+
+
+public class Customer {
+   
+    @GET
+    public String get() {...}
+
+    @Path("/address")
+    public String getAddress() {...}
+
+}
+
+</programlisting>
+
+<para>
+  In the previous example, <literal>getCustomer()</literal> returns a <literal>java.lang.Object</literal>. Per request, at runtime, the JAX-RS server will determine how to dispatch the request based on the object returned by <literal>getCustomer()</literal>. This can be useful in certain situations.
+</para>
+<para>
+  For example, say you have a class heirarchy for your customers. <literal>Customer</literal> is the abstract base, and <literal>CorporateCustomer</literal> and <literal>IndividualCustomer</literal> are subclasses. In this case, your <literal>getCustomer()</literal> method might perform a Hibernate polymorphic query without requiring any understanding of the concrete class it queries, or the content returned.
+</para>
+<programlisting>
+ at Path("/")
+public class ShoppingStore {
+
+   @Path("/customers/{id}")
+   public java.lang.Object getCustomer(@PathParam("id") int id) {
+      Customer cust = entityManager.find(Customer.class, id);
+      return cust;
+   }
+}
+
+
+public class Customer {
+   
+    @GET
+    public String get() {...}
+
+    @Path("/address")
+    public String getAddress() {...}
+
+}
+
+public class CorporateCustomer extendsCustomer {
+   
+    @Path("/businessAddress")
+    public String getAddress() {...}
+
+}
+
+</programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/JBoss.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/JBoss.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/JBoss.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,7 @@
+<chapter id="JBoss5">
+    <title>JBoss 5.x Integration</title>
+    <para>Resteasy 1.1.GA has no special integration with JBoss Application Server so it must be configured and installed
+    like any other container.  There are some issues though.  You must make sure that there is not a copy
+    of servlet-api-xxx.jar in your WEB-INF/lib directory as this may cause problems.  Also, if you are running
+    with JDK 6, make sure to filter out the JAXB jars as they come with JDK 6.</para>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Jaxb.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Jaxb.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Jaxb.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,829 @@
+<chapter id="Built_in_JAXB_providers">
+   <title>JAXB Providers</title>
+
+   <para>
+      RESTEasy includes support for marshalling and unmarshalling JAXB annotated classes. Multiple JAXB Providers are included with RESTEasy to address the subtle differences between classes generated by XJC and classes that are annotated with <literal>@XmlRootElement</literal>, or work with <literal>JAXBElement</literal> classes directly.
+   </para>
+   <para>
+      When using the JAX-RS API in development, the provider to be invoked is selected transparently. This chapter describes the providers best-suited for a variety of configurations if you want to access the providers <emphasis>directly</emphasis>.
+   </para>
+   <para>
+      RESTEasy selects a JAXB Provider when a parameter type (return type) is an object annotated with JAXB annotations (for example, <literal>@XmlRootEntity</literal> or <literal>@XmlType</literal>), or a <literal>JAXBElement</literal>. The resource class (resource method) will be annotated with either <literal>@Consumes</literal> or <literal>@Produces</literal>, and contain one or more of the following values:
+   </para>
+      <itemizedlist>
+
+         <listitem>
+            <para><literal>text/*+xml</literal></para>
+         </listitem>
+
+         <listitem>
+            <para><literal>application/*+xml</literal></para>
+         </listitem>
+
+         <listitem>
+            <para><literal>application/*+fastinfoset</literal></para>
+         </listitem>
+
+         <listitem>
+            <para><literal>application/*+json</literal></para>
+         </listitem>
+
+      </itemizedlist>
+   <para>
+      RESTEasy selects different providers based on the return type used in the resource. This
+      section decribes the workings of the selection process.
+   </para>
+    <para>
+      Classes annotated with <literal>@XmlRootElement</literal> are handled with the <literal>JAXBXmlRootElementProvider</literal>. This provider handles basic marshalling and unmarshalling of custom JAXB entities.
+    </para>
+
+  <para>
+    Classes that are generated by XJC do not usually contain an <literal>@XmlRootElement</literal> annotation. To be marshalled, they must be wrapped in an instance of <literal>JAXBElement</literal>. This usually involves invoking a method named <literal>ObjectFactory</literal> on the class, which serves as the <literal>XmlRegistry</literal>.
+  </para>
+
+   <para>
+      The <literal>JAXBXmlTypeProvider</literal> provider is selected when the class is annotated with an <literal>XmlType</literal> annotation and not an <literal>XmlRootElement</literal> annotation. The provider attempts to locate the <literal>XmlRegistry</literal> for the target class. By default, a JAXB implementation creates a class called <literal>ObjectFactory</literal> and is located in the same package as the target class. <literal>ObjectFactory</literal> contains a <literal>create</literal> method that takes the object instance as a parameter. For example, if the target type is called <literal>Contact</literal>, then the <literal>ObjectFactory</literal> class will have a method:
+   </para>
+   <programlisting>
+      public JAXBElement createContact(Contact value) {..
+   </programlisting>
+   <para>
+      
+      If your resource works with the <literal>JAXBElement</literal> class directly, the RESTEasy runtime will select the <literal>JAXBElementProvider</literal>. This provider examines the <literal>ParameterizedType</literal> value of the <literal>JAXBElement</literal> in order to select the appropriate <literal>JAXBContext</literal>.
+   </para>
+
+
+  <section id="decorators">
+        <title>JAXB Decorators</title>
+        <para>
+	  RESTEasy's JAXB providers can decorate <literal>Marshaller</literal> and <literal>Unmarshaller</literal> instances. Add an annotation that triggers the decoration <literal>Marshaller</literal> or <literal>Unmarshaller</literal>. The decorators can perform tasks such as setting <literal>Marshaller</literal> or <literal>Unmarshaller</literal> properties and setting up validation.
+	</para>
+	<para>
+	  As an example, say you want to create an annotation that will trigger <emphasis>pretty-printing</emphasis> of an XML document. In raw JAXB, we would set a property on the <literal>Marshaller</literal> of <literal>Marshaller.JAXB_FORMATTED_OUTPUT</literal>. Instead, let us write a <emphasis>Marshaller decorator</emphasis>.
+	</para>
+        <para>First, define an annotation:</para>
+ <programlisting>
+ import org.jboss.resteasy.annotations.Decorator;
+
+ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
+ @Retention(RetentionPolicy.RUNTIME)
+ @Decorator(processor = PrettyProcessor.class, target = Marshaller.class)
+ public @interface Pretty {}
+ </programlisting>
+        <para>
+	  For this to work, you must annotate the <literal>@Pretty</literal> annotation with a meta-annotation named <literal>@Decorator</literal>. The <literal>target()</literal> attribute must be the JAXB <literal>Marshaller</literal> class. Next, we will write the <literal>processor()</literal> attribute class.
+	</para>
+ <programlisting>
+ &lt;![CDATA[
+ import org.jboss.resteasy.core.interception.DecoratorProcessor;
+ import org.jboss.resteasy.annotations.DecorateTypes;
+
+ import javax.xml.bind.Marshaller;
+ import javax.xml.bind.PropertyException;
+ import javax.ws.rs.core.MediaType;
+ import javax.ws.rs.Produces;
+ import java.lang.annotation.Annotation;
+
+ /**
+  * @author &lt;a href="mailto:bill at burkecentral.com"&gt;Bill Burke&lt;/a&gt;
+  * @version $Revision: 1 $
+  */
+ @DecorateTypes({"text/*+xml", "application/*+xml"})
+ public class PrettyProcessor implements DecoratorProcessor&lt;Marshaller, Pretty&gt;
+ {
+    public Marshaller decorate(Marshaller target, Pretty annotation,
+                  Class type, Annotation[] annotations, MediaType mediaType)
+    {
+       target.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+    }
+ }
+ ]]&gt;
+ </programlisting>
+    <para>
+	The <literal>processor</literal> implementation must implement the <literal>DecoratorProcessor</literal> interface, and should also be annotated with <literal>@DecorateTypes</literal>. This annotation specifies the media types that the processor can work with.
+    </para>
+    <para>
+	Now that we have defined our annotation and our <literal>Processor</literal>, we can use it on our JAX-RS resource methods or JAXB types like so:
+    </para>
+ <programlisting>
+   @GET
+   @Pretty
+   @Produces("application/xml")
+   public SomeJAXBObject get() {...}
+ </programlisting>
+        <para>
+	    If this is confusing, check the RESTEasy source code for information about implementing <literal>@XmlHeader</literal>.
+	</para>
+    </section>
+    
+   <section id="Pluggable_JAXBContext_s_with_ContextResolvers">
+      <title>Pluggable <literal>JAXBContext</literal>s with <literal>ContextResolvers</literal></title>
+
+      <para>
+	We do not recommend using this feature unless you are familiar with the principles involved.
+      </para>
+      <para>
+	  By default, RESTEasy creates and caches <literal>JAXBContext</literal> instances per class type depending on the class you are marshalling or unmarshalling. If you do not want RESTEasy to create <literal>JAXBContext</literal>s, you can plug in your own by implementing an instance of <literal>javax.ws.rs.ext.ContextResolver</literal>.
+      </para>
+
+
+ <programlisting>
+ public interface ContextResolver&lt;T&gt;
+ {
+T getContext(Class&lt;?&gt; type);
+ }
+
+ @Provider
+ @Produces("application/xml")
+ public class MyJAXBContextResolver implements ContextResolver&lt;JAXBContext&gt;
+ {
+JAXBContext getContext(Class&lt;?&gt; type)
+{
+   if (type.equals(WhateverClassIsOverridedFor.class)) return JAXBContext.newInstance()...;
+}
+ }
+         </programlisting>
+      <para>
+	  You must provide a <literal>@Produces</literal> annotation to specify the types of media intended for the context. You must also implement <literal>ContextResolver&lt;JAXBContext&gt;</literal>. This helps the runtime match the correct context resolver. You must also annotate the <literal>ContextResolver</literal> class with <literal>@Provider</literal>.
+      </para>
+      <para>
+         There are several ways to make this <literal>ContextResolver</literal> available.
+      </para>
+         <orderedlist>
+	    <listitem>
+               <para>
+		  return it as a class or instance from a <literal>javax.ws.rs.core.Application</literal> implementation.
+		</para>
+            </listitem>
+
+            <listitem>
+	      <para>
+               list it as a provider with <literal>resteasy.providers</literal>.
+	      </para>
+	    </listitem>
+
+            <listitem>
+	      <para>
+               let RESTEasy automatically scan for it within your <filename>WAR</filename> file. (See the Configuration Guide for more details.)
+	      </para>
+            </listitem>
+
+            <listitem>
+	      <para>
+               add it manually via <literal>ResteasyProviderFactory.getInstance().registerProvider(Class)</literal> or
+               <literal>registerProviderInstance(Object)</literal>.
+	      </para>
+            </listitem>
+
+         </orderedlist>
+   </section>
+
+
+<section id="JAXB_and_XML_provider">
+      <title>JAXB and XML provider</title>
+       <para>
+           RESTEasy provides the required JAXB provider support for XML. It has several additional annotations to make application coding simpler.
+       </para>
+       <section id="XmlHeader">
+           <title>><literal>@XmlHeader</literal> and <literal>@Stylesheet</literal></title>
+           <para>
+	      To set an XML header when you output XML documents, use the <literal>@org.jboss.resteasy.annotations.providers.jaxb.XmlHeader</literal> annotation.
+	    </para>
+ <programlisting>
+ &lt;![CDATA[
+ at XmlRootElement
+public static class Thing
+{
+   private String name;
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}
+
+ at Path("/test")
+public static class TestService
+{
+
+   @GET
+   @Path("/header")
+   @Produces("application/xml")
+   @XmlHeader("&lt;?xml-stylesheet type='text/xsl' href='${baseuri}foo.xsl' ?&gt;")
+   public Thing get()
+   {
+      Thing thing = new Thing();
+      thing.setName("bill");
+      return thing;
+   }
+}]]&gt;
+ </programlisting>
+	  <para>
+	    Here, the <literal>@XmlHeader</literal> forces an <literal>xml-stylesheet</literal> header on the XML output. The same result can be obtained by placing the header on the <literal>Thing</literal> class. Read the JavaDocs for further information regarding the substitution values provided by RESTEasy.
+	  </para>
+	  <para>
+	    RESTEasy also has a convenient annotation for stylesheet headers. For example:
+	  </para>
+ <programlisting>
+ &lt;![CDATA[
+ at XmlRootElement
+public static class Thing
+{
+   private String name;
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}
+
+ at Path("/test")
+public static class TestService
+{
+
+   @GET
+   @Path("/stylesheet")
+   @Produces("application/xml")
+   @Stylesheet(type="text/css", href="${basepath}foo.xsl")
+   @Junk
+   public Thing getStyle()
+   {
+      Thing thing = new Thing();
+      thing.setName("bill");
+      return thing;
+   }
+}]]&gt;
+ </programlisting>
+       </section>
+   </section>
+   <section id="JAXB_and_JSON_provider">
+      <title>JAXB and JSON provider</title>
+
+      <para>
+	RESTEasy lets you marshal JAXB annotated POJOs to and from JSON with the Jettison JSON library. You can find more information about Jettison at <ulink url="http://jettison.codehaus.org/">http://jettison.codehaus.org/</ulink>.
+      </para>
+      <para>
+	Jettison has two mapping formats: the default <emphasis>Jettison Mapped Convention</emphasis> format, and BadgerFish.
+      </para>
+      <para>
+	For example, consider this JAXB class:
+      </para>
+ <programlisting>
+ @XmlRootElement(name = "book")
+ public class Book
+ {
+private String author;
+private String ISBN;
+private String title;
+
+public Book()
+{
+}
+
+public Book(String author, String ISBN, String title)
+{
+   this.author = author;
+   this.ISBN = ISBN;
+   this.title = title;
+}
+
+ at XmlElement
+public String getAuthor()
+{
+   return author;
+}
+
+public void setAuthor(String author)
+{
+   this.author = author;
+}
+
+ at XmlElement
+public String getISBN()
+{
+   return ISBN;
+}
+
+public void setISBN(String ISBN)
+{
+   this.ISBN = ISBN;
+}
+
+ at XmlAttribute
+public String getTitle()
+{
+   return title;
+}
+
+public void setTitle(String title)
+{
+   this.title = title;
+}
+ }
+         </programlisting>
+      <para>
+         The JAXB <literal>Book</literal> class would be marshalled to JSON using the BadgerFish Convention:
+      </para>
+ <programlisting>
+ {"book":
+    {
+       "@title":"EJB 3.0",
+       "author":{"$":"Bill Burke"},
+       "ISBN":{"$":"596529260"}
+    }
+ }
+ </programlisting>
+      <para>
+	Element values are associated with a map. To find the value of the element, you must access the <literal>$</literal> variable. You could access the book like this, in JavaScript:
+      </para>
+
+ <programlisting>
+ var data = eval("(" + xhr.responseText + ")");
+ document.getElementById("zone").innerHTML = data.book. at title;
+ document.getElementById("zone").innerHTML += data.book.author.$;
+ </programlisting>
+      <para>
+	  To use the BadgerFish Convention you must use the <literal>@org.jboss.resteasy.annotations.providers.jaxb.json.BadgerFish</literal> annotation either on the JAXB class you are marshalling or unmarshalling, or on the JAX-RS resource method or parameter:
+      </para>
+ <programlisting>
+ @BadgerFish
+ @XmlRootElement(name = "book")
+ public class Book {...}
+ </programlisting>
+      <para>
+	To return a <literal>book</literal> on the JAX-RS method without polluting your JAXB classes with RESTEasy annotations, you can add the annotation to the JAX-RS method instead:
+      </para>
+ <programlisting>
+ @BadgerFish
+ @GET
+ public Book getBook(...) {...}
+ </programlisting>
+      <para>
+	If your input is a <literal>Book</literal>, place it on the parameter:
+      </para>
+ <programlisting>
+ @POST
+ public void newBook(@BadgerFish Book book) {...}
+ </programlisting>
+      <para>
+	The default Jettison Mapped Convention returns the following JSON:
+      </para>
+ <programlisting>
+ { "book" :
+      {
+         "@title":"EJB 3.0",
+         "author":"Bill Burke",
+         "ISBN":596529260
+       }
+ }
+ </programlisting>
+      <para>
+	Note that <literal>title</literal> is prefixed with the <literal>@</literal> character. Unlike the BadgerFish convention, this does not represent the value of element text, which makes it simpler (and a sensible default). To access this in JavaScript:
+      </para>
+ <programlisting>
+ var data = eval("(" + xhr.responseText + ")");
+ document.getElementById("zone").innerHTML = data.book. at title;
+ document.getElementById("zone").innerHTML += data.book.author;
+ </programlisting>
+      <para>
+	The Mapped Convention lets you adjust the JAXB mapping with the <literal>@org.jboss.resteasy.annotations.providers.jaxb.json.Mapped</literal> annotation. With this, you can provide an XML namespace to JSON namespace mapping.  For example, if you define your JAXB namespace within your <literal>package-info.java</literal> class like so:
+  </para>
+ <programlisting>
+ @javax.xml.bind.annotation.XmlSchema(namespace="http://jboss.org/books")
+ package org.jboss.resteasy.test.books;
+ </programlisting>
+  <para>
+      You must define a JSON-to-XML namespace mapping, or you will receive an exception:
+  </para>
+ <programlisting>
+ java.lang.IllegalStateException: Invalid JSON namespace: http://jboss.org/books
+ at org.codehaus.jettison.mapped.MappedNamespaceConvention.getJSONNamespace(MappedNamespaceConvention.java:151)
+ at org.codehaus.jettison.mapped.MappedNamespaceConvention.createKey(MappedNamespaceConvention.java:158)
+ at org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeStartElement(MappedXMLStreamWriter.java:241)
+ </programlisting>
+      <para>
+	The <literal>@Mapped</literal> annotation fixes this problem. Place the <literal>@Mapped</literal> annotation on your JAXB classes, your JAX-RS resource method, or on the parameter that you are unmarshalling.
+  </para>
+ <programlisting>
+ import org.jboss.resteasy.annotations.providers.jaxb.json.Mapped;
+ import org.jboss.resteasy.annotations.providers.jaxb.json.XmlNsMap;
+
+ ...
+
+ at GET
+ at Produces("application/json")
+ at Mapped(namespaceMap = {
+        @XmlNsMap(namespace = "http://jboss.org/books", jsonName = "books")
+})
+public Book get() {...}
+
+ </programlisting>
+      <para>
+	You can also force <literal>@XmlAttribute</literal>s to be marshalled as <literal>XMLElements</literal>.
+      </para>
+         <programlisting>
+            @Mapped(attributeAsElements={"title"})
+            @XmlRootElement(name = "book")
+            public class Book {...}
+         </programlisting>
+      <para>
+	To return a <literal>book</literal> on the JAX-RS method without polluting your JAXB classes with RESTEasy annotations, add the annotation to the JAX-RS method:
+      </para>
+         <programlisting>
+            @Mapped(attributeAsElements={"title"})
+            @GET
+            public Book getBook(...) {...}
+         </programlisting>
+      <para>
+	If your input is a <literal>Book</literal>, place it on the parameter:
+      </para>
+ <programlisting>
+ @POST
+ public void newBook(@Mapped(attributeAsElements={"title"}) Book book) {...}
+ </programlisting>
+   </section>
+   <section id="JAXB_and_FastinfoSet_provider">
+      <title>JAXB and FastinfoSet provider</title>
+
+      <para>
+	RESTEasy supports the <literal>Fastinfoset</literal> MIME type through the use of JAXB annotated classes. <literal>Fastinfoset</literal> documents serialize and parse more quickly, and are smaller in size, than logically-equivalent XML documents, so they can be used where size and processing time of XML documents is problematic. It is configured in the same way as the XML JAXB provider.
+      </para>
+   </section>
+   <section id="JAXB_Collections">
+      <title>Arrays and Collections of JAXB Objects</title>
+      <para>
+	RESTEasy automatically marshals arrays, <literal>java.util.Set</literal>s, and <literal>java.util.List</literal>s of JAXB objects to and from XML, JSON, <literal>Fastinfoset</literal>, and other RESTEasy JAXB mappers.
+      </para>
+ <programlisting>
+ &lt;![CDATA[
+ @XmlRootElement(name = "customer")
+ @XmlAccessorType(XmlAccessType.FIELD)
+ public class Customer
+ {
+ at XmlElement
+private String name;
+
+public Customer()
+{
+}
+
+public Customer(String name)
+{
+   this.name = name;
+}
+
+public String getName()
+{
+   return name;
+}
+ }
+
+ @Path("/")
+ public class MyResource
+ {
+   @PUT
+   @Path("array")
+   @Consumes("application/xml")
+   public void putCustomers(Customer[] customers)
+   {
+      Assert.assertEquals("bill", customers[0].getName());
+      Assert.assertEquals("monica", customers[1].getName());
+   }
+
+   @GET
+   @Path("set")
+   @Produces("application/xml")
+   public Set&lt;Customer&gt; getCustomerSet()
+   {
+      HashSet&lt;Customer&gt; set = new HashSet&lt;Customer&gt;();
+      set.add(new Customer("bill"));
+      set.add(new Customer("monica"));
+
+      return set;
+   }
+
+
+   @PUT
+   @Path("list")
+   @Consumes("application/xml")
+   public void putCustomers(List&lt;Customer&gt; customers)
+   {
+      Assert.assertEquals("bill", customers.get(0).getName());
+      Assert.assertEquals("monica", customers.get(1).getName());
+   }
+ }
+ ]]&gt;
+ </programlisting>
+   <para>
+      The resource above publishes and receives JAXB objects. We assume that these are wrapped in a collection element like the following:
+   </para>
+ <programlisting>&lt;![CDATA[
+ &lt;collection&gt;
+&lt;customer&gt;&lt;name&gt;bill&lt;/name&gt;&lt;/customer&gt;
+&lt;customer&gt;&lt;name&gt;monica&lt;/name&gt;&lt;/customer&gt;
+ &lt;collection&gt;
+ ]]&gt;
+ </programlisting>
+    <para>
+      You can change the namespace URI, namespace tag, and collection element name by using the <literal>@org.jboss.resteasy.annotations.providers.jaxb.Wrapped</literal> annotation on a parameter or method:
+    </para>
+ <programlisting>
+ @Target({ElementType.PARAMETER, ElementType.METHOD})
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Wrapped
+ {
+String element() default "collection";
+
+String namespace() default "http://jboss.org/resteasy";
+
+String prefix() default "resteasy";
+ }
+ </programlisting>
+    <para>
+      So, if we wanted to output the following XML:
+    </para>
+ <programlisting>&lt;![CDATA[
+ &lt;foo:list xmlns:foo="http://foo.org"&gt;
+&lt;customer&gt;&lt;name&gt;bill&lt;/name&gt;&lt;/customer&gt;
+&lt;customer&gt;&lt;name&gt;monica&lt;/name&gt;&lt;/customer&gt;
+ &lt;/foo:list&gt;
+ ]]&gt;
+ </programlisting>
+      <para>
+	  We would use the <literal>@Wrapped</literal> annotation as follows:
+      </para>
+ <programlisting>&lt;![CDATA[
+   @GET
+   @Path("list")
+   @Produces("application/xml")
+   @Wrapped(element="list", namespace="http://foo.org", prefix="foo")
+   public List&lt;Customer&gt; getCustomerSet()
+   {
+      List&lt;Customer&gt; list = new ArrayList&lt;Customer&gt;();
+      list.add(new Customer("bill"));
+      list.add(new Customer("monica"));
+
+      return list;
+   }
+ ]]&gt;
+ </programlisting>
+  <section id="json_list">
+    <title>JSON and JAXB Collections/Arrays</title>
+    <para>
+      RESTEasy supports using collections with JSON. It encloses lists, sets, or arrays of returned JAXB objects in a simple JSON array. For example:
+    </para>
+ <programlisting>
+   @XmlRootElement
+ at XmlAccessorType(XmlAccessType.FIELD)
+public static class Foo
+{
+   @XmlAttribute
+   private String test;
+
+   public Foo()
+   {
+   }
+
+   public Foo(String test)
+   {
+      this.test = test;
+   }
+
+   public String getTest()
+   {
+      return test;
+   }
+
+   public void setTest(String test)
+   {
+      this.test = test;
+   }
+}
+ </programlisting>
+      <para>
+	  A List or Array of the <literal>Foo</literal> class would be represented in JSON like so:
+      </para>
+ <programlisting>
+ &lt;![CDATA[
+ [{"foo":{"@test":"bill"}},{"foo":{"@test":"monica}"}}]
+ ]]&gt;
+ </programlisting>
+  <para>
+    It would also expect this format when receiving input.
+  </para>
+  </section>
+</section>
+   <section id="JAXB_Map">
+      <title>Maps of JAXB Objects</title>
+      <para>
+	  RESTEasy automatically marshals maps of JAXB objects to and from XML, JSON, <literal>Fastinfoset</literal>, and other JAXB mappers. Your parameter or method return type must be generic, with a String as the key and the JAXB object's type.
+      </para>
+ <programlisting>
+&lt;![CDATA[
+ at XmlRootElement(namespace = "http://foo.com")
+public static class Foo
+{
+   @XmlAttribute
+   private String name;
+
+   public Foo()
+   {
+   }
+
+   public Foo(String name)
+   {
+      this.name = name;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+}
+
+ at Path("/map")
+public static class MyResource
+{
+   @POST
+   @Produces("application/xml")
+   @Consumes("application/xml")
+   public Map&lt;String, Foo&gt; post(Map&lt;String, Foo&gt; map)
+   {
+      Assert.assertEquals(2, map.size());
+      Assert.assertNotNull(map.get("bill"));
+      Assert.assertNotNull(map.get("monica"));
+      Assert.assertEquals(map.get("bill").getName(), "bill");
+      Assert.assertEquals(map.get("monica").getName(), "monica");
+      return map;
+   }
+ }
+ ]]&gt;
+ </programlisting>
+   <para>
+      This resource publishes and receives JAXB objects within a map. By default, they are wrapped in a <literal>map</literal> element in the default namespace. Each <literal>map</literal> element has zero or more <literal>entry</literal> elements with a <literal>key</literal> attribute.
+   </para>
+ <programlisting>
+ &lt;![CDATA[
+ &lt;map&gt;
+&lt;entry key="bill" xmlns="http://foo.com"&gt;
+    &lt;foo name="bill"/&gt;
+&lt;/entry&gt;
+&lt;entry key="monica" xmlns="http://foo.com"&gt;
+    &lt;foo name="monica"/&gt;
+&lt;/entry&gt;
+ &lt;/map&gt;
+ ]]&gt;
+ </programlisting>
+   <para>
+      You can change the namespace URI, namespace prefix and map, entry, and key element and attribute names by using the <literal>@org.jboss.resteasy.annotations.providers.jaxb.WrappedMap</literal> annotation on a parameter or method.
+    </para>
+ <programlisting>
+ @Target({ElementType.PARAMETER, ElementType.METHOD})
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface WrappedMap
+ {
+/**
+ * map element name
+ */
+String map() default "map";
+
+/**
+ * entry element name *
+ */
+String entry() default "entry";
+
+/**
+ * entry's key attribute name
+ */
+String key() default "key";
+
+String namespace() default "";
+
+String prefix() default "";
+ }
+ </programlisting>
+<para>
+  So, to output the following XML:
+</para>
+ <programlisting>
+ &lt;![CDATA[
+ &lt;hashmap&gt;
+&lt;hashentry hashkey="bill" xmlns:foo="http://foo.com"&gt;
+    &lt;foo:foo name="bill"/&gt;
+&lt;/hashentry&gt;
+ &lt;/map&gt;
+ ]]&gt;
+ </programlisting>
+<para>We would use the @WrappedMap annotation as follows: </para>
+ <programlisting>
+ &lt;![CDATA[
+ at Path("/map")
+public static class MyResource
+{
+   @GET
+   @Produces("application/xml")
+   @WrappedMap(map="hashmap", entry="hashentry", key="hashkey")
+   public Map&lt;String, Foo&gt; get()
+   {
+      ...
+      return map;
+   }
+ ]]&gt;
+ </programlisting>
+  <section id="json_map">
+    <title>JSON and JAXB maps</title>
+    <para>
+	RESTEasy supports the use of maps with JSON. It encloses returned JAXB objects within simple JSON maps. For example:
+    </para>
+ <programlisting>
+   @XmlRootElement
+ at XmlAccessorType(XmlAccessType.FIELD)
+public static class Foo
+{
+   @XmlAttribute
+   private String test;
+
+   public Foo()
+   {
+   }
+
+   public Foo(String test)
+   {
+      this.test = test;
+   }
+
+   public String getTest()
+   {
+      return test;
+   }
+
+   public void setTest(String test)
+   {
+      this.test = test;
+   }
+}
+ </programlisting>
+<para>
+    This a List or array of this Foo class would be represented in JSON like this:
+</para>
+ <programlisting>
+ &lt;![CDATA[
+ { "entry1" : {"foo":{"@test":"bill"}}, "entry2" : {"foo":{"@test":"monica}"}}}
+ ]]&gt;
+ </programlisting>
+ <para>It also expects this format for input</para>
+  </section>
+  <section id="JAXB_JSON_problems">
+      <title>Possible Problems with Jettison Provider</title>
+      <para>
+	  If you have the <filename>resteasy-jackson-provider-xxx.jar</filename> in your classpath, the Jackson JSON provider will be triggered. This is problematic for code that depends upon the Jettison JAXB or JSON provider. To correct this, you must either remove Jackson from your <literal>WEB-INF/lib</literal> or classpath, or use the <literal>@NoJackson</literal> annotation on your JAXB classes.
+      </para>
+  </section>
+</section>
+<section id="JAXB_INTERFACES">
+   <title>Interfaces, Abstract Classes, and JAXB</title>
+   <para>
+      Some object models use abstract classes and interfaces heavily. JAXB does not work with interfaces that are root elements, and RESTEasy cannot unmarshal parameters that are interfaces or raw abstract classes because it lacks the information required to create a <literal>JAXBContext</literal>. For example:
+   </para>
+ <programlisting>
+ public interface IFoo {}
+
+ @XmlRootElement
+ public class RealFoo implements IFoo {}
+
+ @Path("/jaxb")
+ public class MyResource {
+
+ at PUT
+ at Consumes("application/xml")
+public void put(IFoo foo) {...}
+ }
+ </programlisting>
+<para>
+    In this example, RESTEasy would display an error ("Cannot find MessageBodyReader for..." or similar) because RESTEasy does not know that implementations of <literal>IFoo</literal> are JAXB classes, so it cannot create a <literal>JAXBContext</literal> for <literal>IFoo</literal>. As a workaround, you can annotate the interface with <literal>@XmlSeeAlso</literal> to correct the issue.
+</para>
+<note>
+  <para>
+    This will not work with manual, hand-coded JAXB.
+  </para>
+</note>
+ <programlisting>
+ @XmlSeeAlso(RealFoo.class)
+ public interface IFoo {}
+ </programlisting>
+<para>
+  The extra <literal>@XmlSeeAlso</literal> on <literal>IFoo</literal> allows RESTEasy to create a <literal>JAXBContext</literal> that knows how to unmarshal <literal>RealFoo</literal> instances.
+</para>
+</section>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Json.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Json.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Json.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,90 @@
+<chapter id="json">
+    <title>JSON Support via Jackson</title>
+    <para>
+      Apart from the Jettison JAXB adapter for JSON, RESTEasy also supports integration with the Jackson project. Many users find Jackson's output format more intuitive than the format provided by either BadgerFish or Jettison.
+    </para>
+    <para>
+      Jackson is available from <ulink url="http://jackson.codehaus.org">http://jackson.codehaus.org</ulink>. It lets you easily marshal Java objects to and from JSON. Jackson has a JavaBean-based model and JAXB-like APIs. RESTEasy integrates with the JavaBean model as described <ulink url="http://jackson.codehaus.org/Tutorial">in the Jackson Tutorial</ulink>.
+    </para>
+    <para>
+      To include Jackson in your project, add the following Maven dependency to your build:
+    </para>
+
+<programlisting>
+&lt;![CDATA[
+    &lt;repository&gt;
+       &lt;id&gt;jboss&lt;/id&gt;
+       &lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;
+    &lt;/repository&gt;
+
+       ...
+    &lt;dependency&gt;
+       &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+       &lt;artifactId&gt;resteasy-jackson-provider&lt;/artifactId&gt;
+       &lt;version&gt;1.1.GA&lt;/version&gt;
+    &lt;/dependency&gt;
+ ]]&gt;
+</programlisting>
+    <para>
+      RESTEasy expands the JAX-RS integration built into Jackson in several ways. The first expansion provided support for <literal>application/*+json</literal>. Previously, Jackson accepted only <literal>application/json</literal> and <literal>text/json</literal> as valid media types. <literal>application/*+json</literal> support lets you marshal your JSON-based media types with Jackson. For example:
+    </para>
+<programlisting>
+&lt;![CDATA[
+ at Path("/customers")
+public class MyService {
+
+   @GET
+   @Produces("application/vnd.customer+json")
+   public Customer[] getCustomers() {}
+}
+]]&gt;
+</programlisting>
+    <para>
+      Using RESTEasy JAXB providers alongside Jackson is also problematic. Rather than use Jackson to output your JSON, you can use Jettison and JAXB. To do so, you must either not install the Jackson provider, or use the <literal>@org.jboss.resteasy.annotations.providers.NoJackson</literal> annotation on your JAXB annotated classes, like so:
+    </para>
+<programlisting>
+    &lt;![CDATA[
+
+    @XmlRootElement
+    @NoJackson
+    public class Customer {...}
+
+    @Path("/customers")
+    public class MyService {
+
+       @GET
+       @Produces("application/vnd.customer+json")
+       public Customer[] getCustomers() {}
+    }
+    ]]&gt;
+</programlisting>
+        <para>
+	  If you cannot annotate the JAXB class with <literal>@NoJackson</literal>, tehn you can annotate a method parameter instead:
+	</para>
+    <programlisting>
+        &lt;![CDATA[
+
+        @XmlRootElement
+        public class Customer {...}
+
+        @Path("/customers")
+        public class MyService {
+
+           @GET
+           @Produces("application/vnd.customer+json")
+           @NoJackson
+           public Customer[] getCustomers() {}
+
+           @POST
+           @Consumes("application/vnd.customer+json")
+           public void createCustomer(@NoJackson Customer[] customers) {...}
+        }
+        ]]&gt;
+    </programlisting>
+    <section id="Possible_Jackson_Problems">
+        <title>Possible Conflict With JAXB Provider</title>
+        <para>
+	    If your Jackson classes are annotated with JAXB annotations and the <literal>resteasy-jaxb-provider</literal> is on your classpath, you can trigger the Jettison JAXB marshalling code. To disable the JAXB JSON Marshaller, annotate your classes with <literal>@org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes("application/*+json")</literal>.
+        </para>
+    </section>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Maven_and_RESTEasy.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Maven_and_RESTEasy.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Maven_and_RESTEasy.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,129 @@
+<chapter id="Maven_and_RESTEasy">
+   <title>Maven and RESTEasy</title>
+   <para>
+      The JBoss Maven repository is located at <ulink url="http://repository.jboss.org/maven2">http://repository.jboss.org/maven2</ulink>.
+   </para>
+   <para>
+      You can combine them with the following <filename>pom.xml</filename> fragment. RESTEasy is divided into various components. You can mix and match components as required. Remember to replace <replaceable>1.1.GA</replaceable> with the RESTEasy version you want to use.
+   </para>
+<programlisting>
+&lt;![CDATA[
+&lt;repositories&gt;
+   &lt;repository&gt;
+      &lt;id&gt;jboss&lt;/id&gt;
+      &lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;
+   &lt;/repository&gt;
+&lt;/repositories&gt;
+&lt;dependencies&gt;
+   &lt;!-- core library --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+
+   &lt;!-- optional modules --&gt;
+
+   &lt;!-- JAXB support --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-jaxb-provider&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- multipart/form-data and multipart/mixed support --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- Resteasy Server Cache --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-cache-core&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- Ruby YAML support --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-yaml-provider&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- JAXB + Atom support --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-atom-provider&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- JAXB + Atom support --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-atom-provider&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- Apache Abdera Integration --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;abdera-atom-provider&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- Spring integration --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-spring&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+   &lt;!-- Guice integration --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;resteasy-guice&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+
+   &lt;!-- Asynchronous HTTP support with JBossWeb --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;async-http-jbossweb&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+
+   &lt;!-- Asynchronous HTTP support with Servlet 3.0 (Jetty 7 pre5) --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;async-http-servlet-3.0&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+
+   &lt;!-- Asynchronous HTTP support with Tomcat 6 --&gt;
+   &lt;dependency&gt;
+      &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+      &lt;artifactId&gt;async-http-tomcat6&lt;/artifactId&gt;
+      &lt;version&gt;1.1.GA&lt;/version&gt;
+   &lt;/dependency&gt;
+
+&lt;/dependencies&gt;
+]]&gt;
+</programlisting>
+    <para>
+	You can also import a <filename>POM</filename> to ensure that individual module versions need not me specified.
+    </para>
+    <note>
+      <para>
+	  This requires Maven 2.0.9.
+      </para>
+    </note>
+    <programlisting>
+&lt;![CDATA[
+    &lt;dependencyManagement&gt;
+        &lt;dependencies&gt;
+            &lt;dependency&gt;
+                &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+                &lt;artifactId&gt;resteasy-maven-import&lt;/artifactId&gt;
+                &lt;version&lt;1.1.GA&lt;/version&gt;
+                &lt;type&gt;pom&lt;/type&gt;
+                &lt;scope&gt;import&lt;/scope&gt;
+            &lt;/dependency&gt;
+        &lt;/dependencies&gt;
+    &lt;/dependencyManagement&gt;
+]]&gt;
+    </programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Migration_from_older_versions.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Migration_from_older_versions.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Migration_from_older_versions.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,48 @@
+<chapter id="Migration_from_older_versions">
+   <title>Migration from older versions</title>
+   <section id="Migrating_to_Resteasy_Beta_6">
+      <title>Migrating from 1.0.x and 1.1-RC1</title>
+
+             <itemizedlist>
+
+            <listitem>
+                <para>You now turn on Resteasy role-based security i.e. @RolesAllowed, by using the new resteasy.role.based.security context-param.</para>
+            </listitem>
+            <listitem>
+               <para>@Wrapped is now on by default for lists and arrays and sets of JAXB objects.  You can also change the namepace and element names using this annotation.</para>
+            </listitem>
+            <listitem>
+            <para>@Wrapped no longer is enclosed in a resteasy namespace prefix nor uses the http://jboss.org/resteasy namespace.  Its just the default namespace.</para>
+            </listitem>
+            <listitem>
+            <para>@Wrapped JSON is now enclosed in a simple JSON array</para>
+            </listitem>
+             <listitem>
+             <para>If you have the resteasy-jackson-provider-xxx.jar in your classpath, the Jackson JSON provider
+                 will be triggered.  This will screw up code that is dependent on the Jettison JAXB/JSon provider.
+                 If you had been using the Jettison JAXB/Json providers, you must either remove
+                 Jackson from your WEB-INF/lib or classpath, or use the @NoJackson annotation on your JAXB classes.</para>
+             </listitem>
+             <listitem>
+                 <para>The tjws and servlet-api artifacts are now scoped "provided" in the resteasy-jar dependencies.  You may
+                 have to include and scope them as "provided" or "test" within your poms if you are getting class not found errors.</para>
+<programlisting>
+<![CDATA[
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>tjws</groupId>
+            <artifactId>webserver</artifactId>
+            <scope>provided</scope>
+        </dependency>
+]]>
+</programlisting>
+             </listitem>
+         </itemizedlist>
+
+   </section>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Multipart.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Multipart.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Multipart.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,487 @@
+<chapter id="Multipart">
+   <title>Multipart Providers</title>
+   <para>
+      RESTEasy has rich support for the <literal>multipart/*</literal> and <literal>multipart/form-data</literal> MIME (Multipurpose Internet Mail Extension) types. The <literal>multipart</literal> MIME format passes lists of content bodies. Multiple content bodies are embedded in the one message. <literal>multipart/form-data</literal> is often found in web application HTML Form documents, and is generally used to upload files. The <literal>form-data</literal> format works like other <literal>multipart</literal> formats, except that each inlined piece of content has a name associated with it.
+    </para>
+   <para>
+      RESTEasy provides a custom API for reading and writing <literal>multipart</literal> types, as well as marshalling arbitrary List (for any <literal>multipart</literal> type) and Map (<literal>multipart/form-data</literal> only) objects.
+    </para>
+   <section id="MultipartInput">
+      <title>Input with multipart/mixed</title>
+      <para>
+	  When you write a JAX-RS service, RESTEasy provides an interface to let you read any <literal>multipart</literal> MIME type: <literal>org.jboss.resteasy.plugins.providers.multipart.MultipartInput</literal>.
+      </para>
+      <programlisting>
+package org.jboss.resteasy.plugins.providers.multipart;
+
+public interface MultipartInput
+{
+   List&lt;InputPart&gt; getParts();
+
+   String getPreamble();
+}
+
+public interface InputPart
+{
+   MultivaluedMap&lt;String, String&gt; getHeaders();
+
+   String getBodyAsString();
+
+   &lt;T&gt; T getBody(Class&lt;T&gt; type, Type genericType) throws IOException;
+
+   &lt;T&gt; T getBody(org.jboss.resteasy.util.GenericType&lt;T&gt; type) throws IOException;
+
+   MediaType getMediaType();
+}
+      </programlisting>
+      <para>
+	  <literal>MultipartInput</literal> is a simple interface that lets you access each part of the <literal>multipart</literal> message. Each part is represented by an <literal>InputPart</literal> interface, and is associated with a set of headers. You can unmarshal a part by calling one of the <literal>getBody()</literal> methods. The <literal>Type genericType</literal> parameter can be null, but the <literal>Class type</literal> parameter must be set. RESTEasy locates a <literal>MessageBodyReader</literal> based on the media type of the part, and the type information you pass in. The following piece of code unmarshalls XML parts into a JAXB annotated class called <literal>Customer</literal>.
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @PUT
+      @Consumes("multipart/mixed")
+      public void put(MultipartInput input)
+      {
+         List&lt;Customer&gt; customers = new ArrayList...;
+         for (InputPart part : input.getParts())
+         {
+            Customer cust = part.getBody(Customer.class, null);
+            customers.add(cust);
+         }
+      }
+   }
+</programlisting>
+      <para>
+	  If you want to unmarshall a body part that is sensitive to generic type metadata, you can use the <literal>org.jboss.resteasy.util.GenericType</literal> class, like so:
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @PUT
+      @Consumes("multipart/mixed")
+      public void put(MultipartInput input)
+      {
+         for (InputPart part : input.getParts())
+         {
+            List&lt;Customer&gt; cust = part.getBody(new GenericType&gt;List&gt;Customer&lt;&lt;() {});
+         }
+      }
+   }
+
+</programlisting>
+      <para>
+	  <literal>GenericType</literal> is required here because it is the only way to obtain generic type information at runtime.
+      </para>
+   </section>
+   <section id="multipart_list">
+      <title>java.util.List with multipart data</title>
+      <para>
+	  If the body parts are uniform, you can provide a <literal>java.util.List</literal> as your input parameter and avoid unmarshalling each part manually. As you can see in the example code below, this must include the type being unmarshalled with the generic parameter of the List type declaration.
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @PUT
+      @Consumes("multipart/mixed")
+      public void put(List&lt;Customer&gt; customers)
+      {
+         ...
+      }
+   }
+
+</programlisting>
+   </section>
+   <section id="MultipartFormData">
+      <title>Input with multipart/form-data</title>
+      <para>
+	  When you write a JAX-RS service, RESTEasy provides an interface that lets you read the <literal>multipart/form-data</literal> MIME type. <literal>multipart/form-data</literal> is often found in web application HTML Form documents, and is generally used to upload files. The <literal>form-data</literal> format is like other <literal>multipart</literal> formats except that each inlined piece of content is associated with a name. The interface for <literal>form-data</literal> input is <literal>org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput</literal>.
+      </para>
+<programlisting>
+public interface MultipartFormDataInput extends MultipartInput
+{
+   @Deprecated
+   Map&lt;String, InputPart&gt; getFormData();
+
+   Map&lt;String, List&lt;InputPart&gt;&gt; getFormDataMap();
+
+   &lt;T&gt; T getFormDataPart(String key, Class&lt;T&gt; rawType, Type genericType) throws IOException;
+
+   &lt;T&gt; T getFormDataPart(String key, GenericType&lt;T&gt; type) throws IOException;
+}
+</programlisting>
+      <para>
+         This works similarly to <literal>MultipartInput</literal>, as described earlier in this chapter.
+      </para>
+
+   </section>
+   <section id="multipart_map">
+      <title>java.util.Map with multipart/form-data</title>
+      <para>
+	  With <literal>form-data</literal>, if the body parts are uniform, you can provide a <literal>java.util.Map</literal> as your input parameter and avoid unmarshalling each part manually. As you can see in the example code below, this must include the type being unmarshalled with the generic parameter of the List type declaration.
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @PUT
+      @Consumes("multipart/form-data")
+      public void put(Map&lt;String, Customer&gt; customers)
+      {
+         ...
+      }
+   }
+
+</programlisting>
+   </section>
+   <section id="MultipartRelated">
+      <title>Input with multipart/related</title>
+      <para>
+	  When you write a JAX-RS service, RESTEasy provides an interface that lets you read the <literal>multipart/related</literal> MIME type. <literal>multipart/related</literal> indicates that message parts should be considered as parts of a whole, and not individually. You can use <literal>multipart/related</literal> to perform tasks like sending a web page complete with images in a single message.
+      </para>
+      <para>
+	  Every <literal>multipart/related</literal> message has a <literal>root/start</literal> part that references other parts of the message. Parts are identified by their <literal>Content-ID</literal> headers. <literal>multipart/related</literal> is defined by RFC 2387. The interface for <literal>related</literal> input is <literal>org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedInput</literal>.
+      </para>
+<programlisting>
+public interface MultipartRelatedInput extends MultipartInput
+{
+   String getType();
+
+   String getStart();
+
+   String getStartInfo();
+
+   InputPart getRootPart();
+
+   Map&lt;String, InputPart&gt; getRelatedMap();
+}
+</programlisting>
+      <para>
+         It works similarly to <literal>MultipartInput</literal>, as described earlier in this chapter.
+      </para>
+
+   </section>
+   <section id="multipart_output">
+      <title>Output with multipart</title>
+      <para>
+	RESTEasy provides a simple API to output multipart data.
+      </para>
+<programlisting>&lt;![CDATA[
+package org.jboss.resteasy.plugins.providers.multipart;
+
+public class MultipartOutput
+{
+   public OutputPart addPart(Object entity, MediaType mediaType)
+
+   public OutputPart addPart(Object entity, GenericType type, MediaType mediaType)
+
+   public OutputPart addPart(Object entity, Class type, Type genericType, MediaType mediaType)
+
+   public List&lt;OutputPart&gt; getParts()
+
+   public String getBoundary()
+
+   public void setBoundary(String boundary)
+}
+
+public class OutputPart
+{
+   public MultivaluedMap&lt;String, Object&gt; getHeaders()
+
+   public Object getEntity()
+
+   public Class getType()
+
+   public Type getGenericType()
+
+   public MediaType getMediaType()
+}
+
+]]&gt;
+</programlisting>
+      <para>
+	  To output <literal>multipart</literal> data, create a <literal>MultipartOutput</literal> object and call <literal>addPart()</literal> methods. RESTEasy automatically finds a <literal>MessageBodyWriter</literal> to marshall your entity objects. As with <literal>MultipartInput</literal>, your marshalling may be sensitive to generic type metadata. In this case, use <literal>GenericType</literal>. The following example returns a <literal>multipart/mixed</literal> format to the calling client. The parts are JAXB-annotated <literal>Customer</literal> objects that will marshal into <literal>application/xml</literal>.
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @GET
+      @Produces("multipart/mixed")
+      public MultipartOutput get()
+      {
+         MultipartOutput output = new MultipartOutput();
+         output.addPart(new Customer("bill"), MediaType.APPLICATION_XML_TYPE);
+         output.addPart(new Customer("monica"), MediaType.APPLICATION_XML_TYPE);
+         return output;
+      }
+
+</programlisting>
+   </section>
+   <section id="multipart_list_output">
+      <title>Multipart Output with java.util.List</title>
+      <para>
+	If the body parts are uniform, you can provide a <literal>java.util.Map</literal> as your input parameter and avoid unmarshalling each part manually or using a <literal>MultipartOutput</literal> object. As you can see in the example code below, this must include the type being unmarshalled with the generic parameter of the List type declaration. You must also annotate the method with <literal>@PartType</literal> to specify each part's media type. The following example returns a customer list to a client, where each customer is a JAXB object:
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @GET
+      @Produces("multipart/mixed")
+      @PartType("application/xml")
+      public List&lt;Customer&gt; get()
+      {
+         ...
+      }
+   }
+
+</programlisting>
+   </section>
+   <section id="multipart_formdata_output">
+      <title>Output with multipart/form-data</title>
+      <para>RESTEasy provides a simple API to output multipart/form-data.</para>
+<programlisting><![CDATA[
+package org.jboss.resteasy.plugins.providers.multipart;
+
+public class MultipartFormDataOutput extends MultipartOutput
+{
+   public OutputPart addFormData(String key, Object entity, MediaType mediaType)
+
+   public OutputPart addFormData(String key, Object entity, GenericType type, MediaType mediaType)
+
+   public OutputPart addFormData(String key, Object entity, Class type, Type genericType, MediaType mediaType)
+
+   public Map<String, OutputPart> getFormData()
+}
+]]>
+</programlisting>
+      <para>
+	To output <literal>multipart/form-data</literal>, create a <literal>MultipartFormDataOutput</literal> object and call <literal>addFormData()</literal> methods. RESTEasy automatically locates a <literal>MessageBodyWriter</literal> to marshal your entity objects. As with <literal>MultipartInput</literal>, your marshalling may be sensitive to generic type metadata. In this case, use <literal>GenericType</literal>. The example below returns a <literal>multipart/form-data</literal> format to a calling client. The parts are JAXB-annotated <literal>Customer</literal> objects, which will be marshalled into <literal>application/xml</literal>.</para>
+<programlisting>
+   @Path("/form")
+   public class MyService
+   {
+      @GET
+      @Produces("multipart/form-data")
+      public MultipartFormDataOutput get()
+      {
+         MultipartFormDataOutput output = new MultipartFormDataOutput();
+         output.addPart("bill", new Customer("bill"), MediaType.APPLICATION_XML_TYPE);
+         output.addPart("monica", new Customer("monica"), MediaType.APPLICATION_XML_TYPE);
+         return output;
+      }
+
+</programlisting>
+   </section>
+   <section id="multipart_map_output">
+      <title>Multipart FormData Output with java.util.Map</title>
+      <para>
+	If the body parts are uniform, you can provide a <literal>java.util.Map</literal> as your input parameter and avoid unmarshalling each part manually or using a <literal>MultipartFormDataOutput</literal> object. As you can see in the example code below, this must include the type being unmarshalled with the generic parameter of the List type declaration. You must also annotate the method with <literal>@PartType</literal> to specify each part's media type. This example returns a customer list to a client, where each customer is a JAXB object.
+      </para>
+<programlisting>
+   @Path("/multipart")
+   public class MyService
+   {
+      @GET
+      @Produces("multipart/form-data")
+      @PartType("application/xml")
+      public Map&lt;String, Customer&gt; get()
+      {
+         ...
+      }
+   }
+
+</programlisting>
+   </section>
+   <section id="multipart_related_output">
+      <title>Output with multipart/related</title>
+      <para>
+	RESTEasy provides a simple API to output <literal>multipart/related</literal>.
+      </para>
+<programlisting>
+&lt;![CDATA[
+package org.jboss.resteasy.plugins.providers.multipart;
+
+public class MultipartRelatedOutput extends MultipartOutput
+{
+   public OutputPart getRootPart()
+
+   public OutputPart addPart(Object entity, MediaType mediaType,
+      String contentId, String contentTransferEncoding)
+
+   public String getStartInfo()
+
+   public void setStartInfo(String startInfo)
+}
+]]&gt;
+</programlisting>
+      <para>
+	To output <literal>multipart/related</literal>, create a <literal>MultipartRelatedOutput</literal> object and call <literal>addPart()</literal> methods. The first added part is used as the root part of the <literal>multipart/related</literal> message. RESTEasy automatically locates a <literal>MessageBodyWriter</literal> to marshal your entity objects. As with <literal>MultipartInput</literal>, your marshalling may be sensitive to generic type metadata. In this case, use <literal>GenericType</literal>. The example below returns a <literal>multipart/related</literal> format to the calling client &#8212; a HTML file with two images.
+      </para>
+<programlisting>
+ at Path("/related")
+public class MyService
+{
+   @GET
+   @Produces("multipart/related")
+   public MultipartRelatedOutput get()
+   {
+      MultipartRelatedOutput output = new MultipartRelatedOutput();
+      output.setStartInfo("text/html");
+
+      Map&lt;String, String&gt; mediaTypeParameters = new LinkedHashMap&lt;String, String&gt;();
+      mediaTypeParameters.put("charset", "UTF-8");
+      mediaTypeParameters.put("type", "text/html");
+      output
+         .addPart(
+            "&lt;html&gt;&lt;body&gt;\n"
+            + "This is me: &lt;img src='cid:http://example.org/me.png' /&gt;\n"
+            + "&lt;br /&gt;This is you: &lt;img src='cid:http://example.org/you.png' /&gt;\n"
+            + "&lt;/body&gt;&lt;/html&gt;",
+            new MediaType("text", "html", mediaTypeParameters),
+            "&lt;mymessage.xml at example.org&gt;", "8bit");
+      output.addPart("// binary octets for me png",
+            new MediaType("image", "png"), "&lt;http://example.org/me.png&gt;",
+            "binary");
+      output.addPart("// binary octets for you png", new MediaType(
+            "image", "png"),
+            "&lt;http://example.org/you.png&gt;", "binary");
+      client.putRelated(output);
+      return output;
+   }
+}
+</programlisting>
+   </section>
+   <section id="multipartform_annotation">
+      <title>@MultipartForm and POJOs</title>
+      <para>
+	  If you are familiar with your <literal>multipart/form-data</literal> packets, you can map them to and from a POJO class with the <literal>@org.jboss.resteasy.annotations.providers.multipart.MultipartForm</literal> annotation and the <literal>@FormParam</literal> JAX-RS annotation. To do so, define a POJO with a default constructor (at least), and annotate its fields, properties, or both, with <literal>@FormParam</literal>s. These <literal>@FormParam</literal>s must also be annotated with <literal>@org.jboss.resteasy.annotations.providers.multipart.PartType</literal> to be output. For example:
+      </para>
+<programlisting>
+   public class CustomerProblemForm {
+      @FormData("customer")
+      @PartType("application/xml")
+      private Customer customer;
+
+      @FormData("problem")
+      @PartType("text/plain")
+      private String problem;
+
+      public Customer getCustomer() { return customer; }
+      public void setCustomer(Customer cust) { this.customer = cust; }
+      public String getProblem() { return problem; }
+      public void setProblem(String problem) { this.problem = problem; }
+   }
+</programlisting>
+      <para>
+	Once you have defined your POJO class, you can use it to represent <literal>multipart/form-data</literal>. The following code sends a <literal>CustomerProblemForm</literal> using the RESTEasy client framework:
+      </para>
+<programlisting>
+   @Path("portal")
+   public interface CustomerPortal {
+
+      @Path("issues/{id}")
+      @Consumes("multipart/form-data")
+      @PUT
+      public void putProblem(@MultipartForm CustomerProblemForm,
+                             @PathParam("id") int id);
+   }
+
+   {
+       CustomerPortal portal = ProxyFactory.create(CustomerPortal.class, "http://example.com");
+       CustomerProblemForm form = new CustomerProblemForm();
+       form.setCustomer(...);
+       form.setProblem(...);
+
+       portal.putProblem(form, 333);
+   }
+</programlisting>
+      <para>
+	Note that the <literal>@MultipartForm</literal> annotation tells RESTEasy that the object has <literal>@FormParam</literal>, and that it should be marshalled from that parameter. You can use the same object to receive <literal>multipart</literal> data. Here is an example of the server-side counterpart to the customer portal.</para>
+<programlisting>
+   @Path("portal")
+   public class CustomerPortalServer {
+
+      @Path("issues/{id})
+      @Consumes("multipart/form-data")
+      @PUT
+      public void putIssue(@MultipartForm CustomerProblemForm,
+                           @PathParam("id") int id) {
+         ... write to database...
+      }
+   }
+</programlisting>
+   </section>
+   <section id="xop_with_multipart_related">
+      <title>XML-binary Optimized Packaging (Xop)</title>
+      <para>
+	RESTEasy supports packaging XOP (XML-binary Optimized Packaging) messages as <literal>multipart/related</literal>. This means that if you have a JAXB-annotated POJO that also holds some binary content, you can send it without needing to encode the binary in any other way. This results in faster transport while retaining the convenience of the POJO. (You can read more about XOP at the <ulink url="http://www.w3.org/TR/xop10/">W3C web page</ulink>.)
+      </para>
+      <para>
+	Take the following JAXB-annotated POJO as an example. <literal>@XmlMimeType</literal> tells JAXB the MIME type of the binary content. (This is not required, but it is recommended.)
+      </para>
+<programlisting>
+ at XmlRootElement
+ at XmlAccessorType(XmlAccessType.FIELD)
+public static class Xop {
+  private Customer bill;
+
+  private Customer monica;
+
+  @XmlMimeType(MediaType.APPLICATION_OCTET_STREAM)
+  private byte[] myBinary;
+
+  @XmlMimeType(MediaType.APPLICATION_OCTET_STREAM)
+  private DataHandler myDataHandler;
+
+  // methods, other fields ...
+}
+</programlisting>
+      <para>
+	Here, <literal>myBinary</literal> and <literal>myDataHandler</literal> are processed as binary attachments, while the XOP object will be sent as XML. <literal>javax.activation.DataHandler</literal> is the most common supported type, so if you need a <literal>java.io.InputStream</literal> or a <literal>javax.activation.DataSource</literal>, you must use the <literal>DataHandler</literal>. <literal>java.awt.Image</literal> and <literal>javax.xml.transform.Source</literal> are also supported. We assume, in the previous example, that <literal>Customer</literal> is a JAXB-friendly POJO. The following is an example Java client to send the previous example:
+      </para>
+<programlisting>
+// our client interface:
+ at Path("mime")
+public static interface MultipartClient {
+  @Path("xop")
+  @PUT
+  @Consumes(MediaType.MULTIPART_RELATED)
+  public void putXop(@XopWithMultipartRelated Xop bean);
+}
+
+// Somewhere using it:
+{
+  MultipartClient client = ProxyFactory.create(MultipartClient.class,
+    "http://www.example.org");
+  Xop xop = new Xop(new Customer("bill"), new Customer("monica"),
+    "Hello Xop World!".getBytes("UTF-8"),
+    new DataHandler(new ByteArrayDataSource("Hello Xop World!".getBytes("UTF-8"),
+    MediaType.APPLICATION_OCTET_STREAM)));
+  client.putXop(xop);
+}
+</programlisting>
+	<para>
+	  <literal>@Consumes(MediaType.MULTIPART_RELATED)</literal> tells RESTEasy that we want to send <literal>multipart/related</literal> packages, a format that will hold our XOP message. <literal>@XopWithMultipartRelated</literal> tells RESTEasy that we want to create XOP messages. Now that we have a POJO and a client service capable of sending it, we need a server capable of reading it:
+	</para>
+<programlisting>
+ at Path("/mime")
+public class XopService {
+  @PUT
+  @Path("xop")
+  @Consumes(MediaType.MULTIPART_RELATED)
+  public void putXopWithMultipartRelated(@XopWithMultipartRelated Xop xop) {
+    // do very important things here
+  }
+}
+</programlisting>
+	<para>
+	  <literal>@Consumes(MediaType.MULTIPART_RELATED)</literal> tells RESTEasy that we want to read <literal>multipart/related</literal> packages. <literal>@XopWithMultipartRelated</literal> tells RESTEasy that we want to read XOP messages. We could also produce XOP return values by annotating them with <literal>@Produce</literal>.
+	</para>
+   </section>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Overview.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Overview.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Overview.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,36 @@
+<chapter id="Overview">
+<title>Overview</title>
+
+<para>
+JSR-000311 JAX-RS is a Java Community Process (JCP) specification that provides a Java API for RESTful Web Services over the HTTP protocol. <application>RESTEasy</application> is a portable implementation of the JAX-RS specification that can run in any Servlet container, and integrates tightly with the JBoss Application Server (JBoss AS) to provide improved user experience in the JBoss AS environment. Where JAX-RS is a server-side only specification, RESTEasy brings JAX-RS functions to the client side through the RESTEasy JAX-RS Client Framework, allowing you to map outgoing HTTP requests to remote servers with JAX-RS and interface proxies.</para>
+
+
+<itemizedlist>
+  <listitem>
+    <para>
+      RESTEasy includes the JAX-RS implementation.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      RESTEasy is portable to any Tomcat or Application Server that runs on Java Development Kit 5.0 or higher.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The RESTEasy server implementation can be used with Embedded JBoss for junit testing.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      RESTEasy integrates easily with Enterprise JavaBeans (EJB) and the Spring Framework.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      RESTEasy includes a client framework to simplify the process of writing HTTP clients, giving you the opportunity to define more than server bindings.
+    </para>
+  </listitem>
+</itemizedlist>
+
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Client_Framework.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Client_Framework.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Client_Framework.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,242 @@
+<chapter id="RESTEasy_Client_Framework">
+    <title>Client Framework</title>
+
+    <para>
+	The RESTEasy Client Framework is the alternative to the JAX-RS server-side specification. Instead of using JAX-RS annotations to map an incoming request to your RESTful Web Service method, the client framework creates a HTTP request to invoke on a remote RESTful Web Service, which can be any web resource that accepts HTTP requests.
+    </para>
+    <para>
+	RESTEasy has a client proxy framework that lets you invoke upon a remote HTTP resource by using JAX-RS annotations. You can write a Java interface and use JAX-RS annotations on methods and the interface. For example:
+    </para>
+<programlisting>
+public interface SimpleClient
+{
+   @GET
+   @Path("basic")
+   @Produces("text/plain")
+   String getBasic();
+
+   @PUT
+   @Path("basic")
+   @Consumes("text/plain")
+   void putBasic(String body);
+
+   @GET
+   @Path("queryParam")
+   @Produces("text/plain")
+   String getQueryParam(@QueryParam("param")String param);
+
+   @GET
+   @Path("matrixParam")
+   @Produces("text/plain")
+   String getMatrixParam(@MatrixParam("param")String param);
+
+   @GET
+   @Path("uriParam/{param}")
+   @Produces("text/plain")
+   int getUriParam(@PathParam("param")int param);
+}</programlisting>
+    <para>
+	The RESTEasy API is simple, and based on Apache HttpClient. You generate a proxy, and invoke methods on the proxy. The invoked method is then translated to a HTTP request (based on the method's annotations) and posted to the server. To set it up:
+    </para>
+        <programlisting>
+            import org.resteasy.plugins.client.httpclient.ProxyFactory;
+            ...
+            // this initialization only needs to be done once per VM
+            RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
+
+
+            SimpleClient client = ProxyFactory.create(SimpleClient.class, "http://localhost:8081");
+            client.putBasic("hello world");
+        </programlisting>
+
+    <para>
+
+        See the <literal>ProxyFactory</literal> Java Documentation for more options. For instance, you may want to fine tune the <literal>HttpClient</literal> configuration.
+    </para>
+    <para>
+	<literal>@CookieParam</literal> creates a cookie header to send to the server. If you allocate your own <literal>javax.ws.rs.core.Cookie</literal> object and pass it as a parameter to a client proxy method, you do not require <literal>@CookieParam</literal> &#8212; the client framework understands that you are passing a cookie to the server, so no extra metadata is required.
+    </para>
+    <para>
+	The client framework can use the same providers available on the server. You must manually register them through the <literal>ResteasyProviderFactory</literal> singleton using the <literal>addMessageBodyReader()</literal> and <literal>addMessageBodyWriter()</literal> methods.
+    </para>
+    <programlisting>
+        ResteasyProviderFactory.getInstance().addMessageBodyReader(MyReader.class);
+    </programlisting>
+    <section id="Custom_client-side_responses">
+        <title>Abstract Responses</title>
+
+        <para>
+	    When you need to access the response code or the response headers of a client request, the <literal>Client-Proxy</literal> framework provides two options:
+        </para>
+        <para>
+	    You can return a <literal>javax.ws.rs.core.Response.Status</literal> enumeration from your method calls, like so:
+        </para>
+            <programlisting>
+ at Path("/")
+public interface MyProxy {
+   @POST
+   Response.Status updateSite(MyPojo pojo);
+}
+            </programlisting>
+        <para>
+	    After invoking on the server, the client proxy internally converts the HTTP response code into a <literal>Response.Status</literal> enumeration.
+        </para>
+        <para>
+	    You can retrieve all data associated with a request with the <literal>org.resteasy.spi.ClientResponse</literal> interface:
+        </para>
+        <programlisting>
+	&lt;![CDATA[
+/**
+ * Response extension for the RESTEasy client framework. Use this, or Response
+ * in your client proxy interface method return type declarations if you want
+ * access to the response entity as well as status and header information.
+ *
+ * @author &lt;a href="mailto:bill at burkecentral.com"&gt;Bill Burke&lt;/a&gt;
+ * @version $Revision: 1 $
+ */
+public abstract class ClientResponse&lt;T&gt; extends Response
+{
+   /**
+    * This method returns the same exact map as Response.getMetadata() except as a map of strings 
+    * rather than objects.
+    *
+    * @return
+    */
+   public abstract MultivaluedMap&lt;String, String&gt; getHeaders();
+
+   public abstract Response.Status getResponseStatus();
+
+   /**
+    * Unmarshal the target entity from the response OutputStream.  You must have type information
+    * set via &lt;T&gt; otherwise, this will not work.
+    * &lt;p/&gt;
+    * This method actually does the reading on the OutputStream.  It will only do the read once.  
+    * Afterwards, it will cache the result and return the cached result.
+    *
+    * @return
+    */
+   public abstract T getEntity();
+
+   /**
+    * Extract the response body with the provided type information
+    * &lt;p/&gt;
+    * This method actually does the reading on the OutputStream.  It will only do the read once.  
+    * Afterwards, it will cache the result and return the cached result.
+    *
+    * @param type
+    * @param genericType
+    * @param &lt;T2&gt;
+    * @return
+    */
+   public abstract &lt;T2&gt; T2 getEntity(Class&lt;T2&gt; type, Type genericType);
+
+   /**
+    * Extract the response body with the provided type information.  GenericType is a trick used to
+    * pass in generic type information to the resteasy runtime.
+    * &lt;p/&gt;
+    * For example:
+    * &lt;pre&gt;
+    * List&lt;String&gt; list = response.getEntity(new GenericType&lt;List&lt;String&gt;() {});
+    * &lt;p/&gt;
+    * &lt;p/&gt;
+    * This method actually does the reading on the OutputStream.  It will only do the read once.  Afterwards, it will
+    * cache the result and return the cached result.
+    *
+    * @param type
+    * @param &lt;T2&gt;
+    * @return
+    */
+   public abstract &lt;T2&gt; T2 getEntity(GenericType&lt;T2&gt; type);
+}
+]]&gt;
+        </programlisting>
+        <para>
+	    All <literal>getEntity()</literal> methods are deferred until you invoke them. In other words, the response <literal>OutputStream</literal> is not read until you call one of these methods. The <literal>getEntity()</literal> method with no parameters can only be used if you have templated the <literal>ClientResponse</literal> within your method declaration. RESTEasy uses this generic type information to determine which media type the <literal>OutputStream</literal> is unmarshalled into. The <literal>getEntity()</literal> methods that take parameters let you specify the Object type the response should be marshalled into. This lets you dynamically extract the desired types at runtime. For example:
+        </para>
+            <programlisting>
+ at Path("/")
+public interface LibraryService {
+
+   @GET
+   @Produces("application/xml")
+   ClientResponse&lt;LibraryPojo&gt; getAllBooks();
+}</programlisting>
+        <para>
+	  Include the <literal>LibraryPojo</literal> in <literal>ClientResponse</literal>'s generic declaration so that the client proxy framework can unmarshal the HTTP response body.
+        </para>
+    </section>
+    <section id="Sharing_interfaces">
+        <title>Sharing an interface between client and server</title>
+        <para>
+	    It is usually possible to share an interface between the client and server. In the previous scenario, your JAX-RS services must implement an annotated interface, then reuse that same interface to create client proxies to invoke on the client side. However, this is limited when your JAX-RS methods return a Response object. This is problematic because, in a raw Response return type declaration, the client has no type information. There are two ways to work around this problem. The first is to use the <literal>@ClientResponseType</literal> annotation.
+        </para>
+        <programlisting>
+import org.jboss.resteasy.annotations.ClientResponseType;
+import javax.ws.rs.core.Response;
+
+ at Path("/")
+public interface MyInterface {
+
+   @GET
+   @ClientResponseType(String.class)
+   @Produces("text/plain")
+   public Response get();
+}</programlisting>
+        <para>
+	    This will not always work, because some <literal>MessageBodyReader</literal>s and <literal>MessageBodyWriter</literal>s need generic type information in order to match and service a request.
+        </para>
+<programlisting>
+ at Path("/")
+public interface MyInterface {
+
+   @GET
+   @Produces("application/xml")
+   public Response getMyListOfJAXBObjects();
+}</programlisting>
+        <para>
+            In this case, your client code can cast the returned Response object to a <literal>ClientResponse</literal> and use one of the typed <literal>getEntity()</literal> methods.
+        </para>
+        <programlisting>&lt;![CDATA[
+MyInterface proxy = ProxyFactory.create(MyInterface.class, "http://localhost:8081");
+ClientResponse response = (ClientResponse)proxy.getMyListOfJAXBObjects();
+List&lt;MyJaxbClass&gt; list = response.getEntity(new GenericType&lt;List&lt;MyJaxbClass&gt;&gt;());
+]]&gt;</programlisting>
+
+    </section>
+    <section id="Client_error_handling">
+        <title>Client error handling</title>
+
+        <para>
+	    If you are using the Client Framework and your proxy methods return something other than a <literal>ClientResponse</literal>, the default client error handling comes into play. Any response code that is greater than <literal>399</literal> will automatically cause a <exceptionname>org.jboss.resteasy.client.ClientResponseFailure</exceptionname> exception:
+        </para>
+<programlisting>
+   @GET
+   ClientResponse&lt;String&gt; get() // will throw an exception if you call getEntity()
+
+   @GET
+   MyObject get(); // will throw a ClientResponseFailure on response code &gt; 399
+</programlisting>
+    </section>
+   <section id="ClientRequest">
+   <title>Manual ClientRequest API</title>
+   <para>
+      RESTEasy has a manual API for invoking requests: <literal>org.jboss.resteasy.client.ClientRequest</literal> See the Java Documentation for a complete description of this class. A simple example is the following:
+  </para>
+<programlisting>
+
+&lt;![CDATA[   ClientRequest request = new ClientRequest("http://localhost:8080/some/path");
+   request.header("custom-header", "value");
+
+   // We're posting XML and a JAXB object
+   request.body("application/xml", someJaxb);
+
+   // we're expecting a String back
+   ClientResponse&lt;String&gt; response = request.post(String.class);
+   
+   if (response.getStatus() == 200) // OK!
+   {
+      String str = response.getEntity();
+   }]]&gt;
+</programlisting>
+   </section>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_EJB_Integration.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_EJB_Integration.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_EJB_Integration.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,77 @@
+<chapter id="RESTEasy_EJB_Integration">
+<title>EJB Integration</title>
+
+<para>
+    To integrate with Enterprise JavaBeans (EJB), you must first modify your EJB's published interfaces. Currently, RESTEasy only has simple portable integration with EJBs, so you must manually configure your RESTEasy <filename>WAR</filename>.
+</para>
+<para>
+  To make an EJB a JAX-RS resource, annotate a stateless session bean's <literal>@Remote</literal> or <literal>@Local</literal> interface with JAX-RS annotations, as follows:
+</para>
+<programlisting>
+ at Local
+ at Path("/Library")
+public interface Library {
+   
+   @GET
+   @Path("/books/{isbn}")
+   public String getBook(@PathParam("isbn") String isbn);
+}
+
+ at Stateless
+public class LibraryBean implements Library {
+
+...
+
+}
+</programlisting>
+<para>
+  Next, in RESTEasy's <filename>web.xml</filename>, manually register the EJB with RESTEasy by using the <literal>resteasy.jndi.resources &lt;context-param&gt;</literal>:
+</para>
+<programlisting>
+&lt;web-app&gt;
+   &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
+   &lt;context-param&gt;
+      &lt;param-name&gt;resteasy.jndi.resources&lt;/param-name&gt;
+      &lt;param-value&gt;LibraryBean/local&lt;/param-value&gt;
+   &lt;/context-param&gt;
+
+   &lt;listener&gt;
+      &lt;listener-class&gt;org.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
+   &lt;/listener&gt;
+
+   &lt;servlet&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;servlet-class&gt;org.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
+   &lt;/servlet&gt;
+
+   &lt;servlet-mapping&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+   &lt;/servlet-mapping&gt;
+
+&lt;/web-app&gt;
+</programlisting>
+<para>
+    At present, this is the only portable integration method for EJBs. Future versions of RESTEasy will be more tightly integrated with JBoss AS, so manual registrations and modifications to <filename>web.xml</filename> will be unnecessary.
+</para>
+<para>
+    If you are using RESTEasy with an <filename>EAR</filename> and EJBs, the following structure is helpful:
+</para>
+<programlisting>
+my-ear.ear
+|------myejb.jar
+|------resteasy-jaxrs.war
+       |
+       ----WEB-INF/web.xml
+       ----WEB-INF/lib (nothing)
+|------lib/
+       |
+       ----All Resteasy jar files
+</programlisting>
+<para>
+    Remove all libraries from <filename>WEB-INF/lib</filename> and place them in a common <filename>EAR</filename> library, or place the RESTEasy <filename>JAR</filename> dependencies in your application server's system classpath (that is, in JBoss AS, place them in <filename>server/default/lib</filename>).
+</para>
+<!--<para>
+    An example EAR project is available from our testsuite here.
+</para>-->
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Embedded_Container.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Embedded_Container.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Embedded_Container.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,51 @@
+<chapter id="RESTEasy_Embedded_Container">
+<title>Embedded Container</title>
+
+<para>
+  RESTEasy JAX-RS comes with an embeddable server that can be run from your classpath. It packages the TJWS (Tiny Java Web Server) embeddable Servlet container with JAX-RS.
+</para>
+<para>
+  From the distribution, move the <filename>JAR</filename>s in <filename>resteasy-jaxrs.war/WEB-INF/lib</filename> into your classpath. You must register your JAX-RS beans programmatically using the embedded server's <literal>Registry</literal>.  Here's an example:
+</para>
+
+<programlisting>
+
+ at Path("/")
+public class MyResource {
+
+   @GET
+   public String get() { return "hello world"; }
+ 
+
+   public static void main(String[] args) throws Exception 
+   {
+      TJWSEmbeddedJaxrsServer tjws = new TJWSEmbeddedJaxrsServer();
+      tjws.setPort(8081);
+      tjws.getRegistry().addPerRequestResource(MyResource.class);
+      tjws.start();
+   }
+}
+
+</programlisting>
+<para>
+  The server can either host non-encrypted or SSL-based resources, but not both. See the Java Documentation for <literal>TJWSEmbeddedJaxrsServer</literal> and its superclass <literal>TJWSServletServer</literal> for further information. The TJWS website is also very informative.
+</para>
+<para>
+  To use Spring, you will need the <literal>SpringBeanProcessor</literal>. Here is a pseudo-code example:
+</para>
+<programlisting>
+
+   public static void main(String[] args) throws Exception 
+   {
+      final TJWSEmbeddedJaxrsServer tjws = new TJWSEmbeddedJaxrsServer();
+      tjws.setPort(8081);
+
+      org.resteasy.plugins.server.servlet.SpringBeanProcessor processor = new SpringBeanProcessor(tjws.getRegistry(), tjws.getFactory();
+      ConfigurableBeanFactory factory = new XmlBeanFactory(...);
+      factory.addBeanPostProcessor(processor);
+
+      tjws.start();
+   }
+
+</programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Reference_Guide.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Reference_Guide.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Reference_Guide.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"  [ ]>
+
+<book>
+
+   <!--<bookinfo>
+      <title>RESTEasy JAX-RS</title>
+      <subtitle>RESTFul Web Services for Java</subtitle>
+      <releaseinfo>1.1.GA</releaseinfo>
+   </bookinfo>
+
+   <toc/>
+
+   <preface id="preface" revision="1">
+      <title>Preface</title>
+      <para>
+         Commercial development support, production support and training for RESTEasy JAX-RS is
+         available through JBoss, a division of Red Hat Inc. (see http://www.jboss.com/).
+      </para>
+
+      <para>
+         In some of the example listings, what is meant to be displayed on one line does not fit
+         inside the available page width. These lines have been broken up. A '\' at the end of a
+         line means that a break has been introduced to fit in the page, with the following lines
+         indented. So:
+         <programlisting>
+            Let's pretend to have an extremely \
+            long line that \
+            does not fit
+            This one is short
+         </programlisting>
+         Is really:
+         <programlisting>
+            Let's pretend to have an extremely long line that does not fit
+            This one is short
+         </programlisting>
+      </para>
+   </preface>-->
+
+    <xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Installation_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="Using_Path.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="_PathParam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="_QueryParam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="_HeaderParam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="_MatrixParam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="_CookieParam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="_FormParam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="_Form.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="_DefaultValue.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="_Encoded_and_encoding.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="_Context.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="JAX-RS_Resource_Locators_and_Sub_Resources.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="JAX-RS_Content_Negotiation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <!--<xi:include href="Content_Marshalling_Providers.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
+<xi:include href="Jaxb.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<!--<xi:include href="Atom.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
+    <xi:include href="Json.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="Multipart.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="Yaml.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="StringConverter.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+  <xi:include href="Responses_using_coreResponse.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="ExceptionMappers.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Configuring_Individual_JAX-RS_Resource_Beans.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="gzip.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Cache_NoCache_CacheControl.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Interceptors.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Asynchronous_HTTP.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Async_job_service.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="RESTEasy_Embedded_Container.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="RESTEasy_Server-side_Mock_Framework.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Securing_JAX-RS_and_RESTeasy.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="RESTEasy_EJB_Integration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="RESTEasy_Spring_Integration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="Seam.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="Guice1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="RESTEasy_Client_Framework.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="Maven_and_RESTEasy.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+   <xi:include href="JBoss.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<!--   <xi:include href="Migration_from_older_versions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
+   <xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+</book>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Server-side_Mock_Framework.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Server-side_Mock_Framework.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Server-side_Mock_Framework.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,30 @@
+<chapter id="RESTEasy_Server-side_Mock_Framework">
+<title>Server-side Mock Framework</title>
+
+<para>
+  RESTEasy provides a mock framework so that you can invoke directly on your resource, without using the embeddable container.
+</para>
+<programlisting>
+import org.resteasy.mock.*;
+...
+
+      Dispatcher dispatcher = MockDispatcherFactory.createDispatcher();
+
+      POJOResourceFactory noDefaults = new POJOResourceFactory(LocatingResource.class);
+      dispatcher.getRegistry().addResourceFactory(noDefaults);
+
+      {
+         MockHttpRequest request = MockHttpRequest.get("/locating/basic");
+         MockHttpResponse response = new MockHttpResponse();
+
+         dispatcher.invoke(request, response);
+
+
+         Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatus());
+         Assert.assertEquals("basic", response.getContentAsString());
+      }
+</programlisting>
+<para>
+  See the RESTEasy Java Documentation for a complete list of the methods associated with <literal>MockHttpRequest</literal> and <literal>MockHttpResponse</literal>.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Spring_Integration.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Spring_Integration.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/RESTEasy_Spring_Integration.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,107 @@
+<chapter id="RESTEasy_Spring_Integration">
+<title>Spring Integration</title>
+
+<para>
+    RESTEasy integrates with Spring 2.5. (We are interested in other forms of Spring integration, and encourage you to contribute.)
+</para>
+<section id="SpringBeanProcessor">
+   <title>Basic Integration</title>
+<para>For Maven users, you must use the resteasy-spring artifact.  Otherwise, the jar is available in the downloaded distribution.
+</para>
+<programlisting>
+&lt;![CDATA[
+&lt;dependency&gt;
+    &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
+    &lt;artifactId&gt;resteasy-spring&lt;/artifactId&gt;
+    &lt;version&gt;whatever version you are using&lt;/version&gt;
+&lt;/dependency&gt;
+]]&gt;
+</programlisting>
+<para>
+  RESTEasy includes its own Spring <literal>ContextLoaderListener</literal>. This registers a RESTEasy-specific <literal>BeanPostProcessor</literal> that processes JAX-RS annotations when a bean is created by a <literal>BeanFactory</literal>. This means that RESTEasy automatically scans for <literal>@Provider</literal> and JAX-RS resource annotations on your bean class and registers them as JAX-RS resources.
+</para>
+<para>
+  You will need to alter your <filename>web.xml</filename> file:
+</para>
+<programlisting>
+&lt;web-app&gt;
+   &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
+
+   &lt;listener&gt;
+      &lt;listener-class&gt;org.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
+   &lt;/listener&gt;
+
+   &lt;listener&gt;
+      &lt;listener-class&gt;org.resteasy.plugins.spring.SpringContextLoaderListener&lt;/listener-class&gt;
+   &lt;/listener&gt;
+
+   &lt;servlet&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;servlet-class&gt;org.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
+   &lt;/servlet&gt;
+
+   &lt;servlet-mapping&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+   &lt;/servlet-mapping&gt;
+
+
+&lt;/web-app&gt;
+</programlisting>
+<para>
+  The <literal>SpringContextLoaderListener</literal> must be declared after <literal>ResteasyBootstrap</literal> because it uses ServletContext attributes initialized by <literal>ResteasyBootstrap</literal>.
+</para>
+<para>
+  If you do not use a Spring <literal>ContextLoaderListener</literal> to create your bean factories, you can manually register the RESTEasy <literal>BeanFactoryPostProcessor</literal> by allocating an instance of <literal>org.jboss.resteasy.plugins.spring.SpringBeanProcessor</literal>. You can obtain instances of a <literal>ResteasyProviderFactory</literal> and <literal>Registry</literal> from the <literal>ServletContext</literal> attribute, <literal>org.resteasy.spi.ResteasyProviderFactory and org.resteasy.spi.Registry</literal> (the fully-qualified name String of these classes). There is also <literal>org.jboss.resteasy.plugins.spring.SpringBeanProcessorServletAware</literal>, which automatically injects references to the <literal>Registry</literal> and <literal>ResteasyProviderFactory</literal> from the Servlet Context, assuming that you have used <literal>RestasyBootstrap</literal> to bootstrap RESTEasy.
+</para>
+<para>
+    RESTEasy Spring integration supports both singletons and the <emphasis>prototype</emphasis> scope. It handles injecting <literal>@Context</literal> references. However, constructor injection is not supported, and when the <emphasis>prototype</emphasis> scope is used, RESTEasy injects any <literal>@*Param</literal>-annotated fields and setters before the request is dispatched.
+</para>
+<note>
+  <para>
+    You can only use automatically proxied beans with RESTEasy Spring integration. Hand-coded proxying (that is, with <literal>ProxyFactoryBean</literal>) will have undesirable effects.
+  </para>
+</note>
+</section>
+<section id="SpringMVC">
+   <title>Spring MVC Integration</title>
+   <para> 
+      RESTEasy can also integrate with the Spring <literal>DispatcherServlet</literal>. This is advantageous because the <filename>web.xml</filename> is simpler, you can dispatch to either Spring controllers or RESTEasy from under the same base URL, and you can use Spring <literal>ModelAndView</literal> objects as return arguments from <literal>@GET</literal> resource methods. To set this up, you must use the Spring <literal>DispatcherServlet</literal> in your <filename>web.xml</filename> file, and import the <filename>springmvc-resteasy.xml</filename> file into your base Spring beans xml file. Here is an example <filename>web.xml</filename> file:
+   </para>
+<programlisting>
+&lt;web-app&gt;
+   &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
+
+   &lt;servlet&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet;&lt;/servlet-class&gt;
+   &lt;/servlet&gt;
+
+   &lt;servlet-mapping&gt;
+      &lt;servlet-name&gt;Spring&lt;/servlet-name&gt;
+      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+   &lt;/servlet-mapping&gt;
+
+
+&lt;/web-app&gt;
+</programlisting>
+<para>
+  Then, within your main Spring beans xml file, import the <filename>springmvc-resteasy.xml</filename> file.
+</para>
+<programlisting>
+&lt;![CDATA[
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+"&gt;
+
+    &lt;!-- Import basic SpringMVC Resteasy integration --&gt;
+    &lt;import resource="classpath:springmvc-resteasy.xml"/&gt;
+....
+]]&gt;
+</programlisting>
+</section>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Responses_using_coreResponse.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Responses_using_coreResponse.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Responses_using_coreResponse.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,7 @@
+<chapter id="Responses_using_javax.ws.rs.core.Response">
+<title>Responses using javax.ws.rs.core.Response</title>
+
+<para>
+    You can build custom responses by using the <literal>javax.ws.rs.core.Response</literal> and <literal>ResponseBuilder</literal> classes. To perform your own streaming, your entity response must be an implementation of <literal>javax.ws.rs.core.StreamingOutput</literal>. See the Java Documentation for further information.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Revision_History.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Revision_History.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Revision_History.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,27 @@
+
+<?xml version='1.0'?>
+
+
+
+<appendix id="appe-Publican-Revision_History">
+    <title>Revision History</title>
+    <simpara>
+        <revhistory>
+            <revision>
+                <revnumber>1.0</revnumber>
+                <date>30 July 2009</date>
+                <author>
+                    <firstname>Laura</firstname>
+                    <surname>Bailey</surname>
+                    <email>lbailey at redhat.com</email>
+                </author>
+                <revdescription>
+                    <simplelist>
+                        <member></member>
+                    </simplelist>
+                </revdescription>
+            </revision>
+        </revhistory>
+    </simpara>
+</appendix>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Seam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Seam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Seam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,6 @@
+<chapter id="Seam">
+    <title>Seam Integration</title>
+    <para>
+	RESTEasy integrates closely with the JBoss Seam Framework. This integration is maintained and documented by the Seam developers at <ulink url="http://seamframework.org">seamframework.org</ulink>.
+    </para>
+</chapter>
\ No newline at end of file

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Securing_JAX-RS_and_RESTeasy.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Securing_JAX-RS_and_RESTeasy.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Securing_JAX-RS_and_RESTeasy.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,97 @@
+<chapter id="Securing_JAX-RS_and_RESTeasy">
+<title>Securing JAX-RS and RESTeasy</title>
+
+<para>
+    Because RESTEasy is deployed as a Servlet, you must use standard <filename>web.xml</filename> constraints to enable authentication and authorization.
+</para>
+<para>
+  Unfortunately, <filename>web.xml</filename> constraints have limited compatibility with JAX-RS because of the limited URL pattern matching available in <filename>web.xml</filename>. URL patterns in <filename>web.xml</filename> support only simple wildcards, so JAX-RS resources like the following:
+</para>
+<programlisting>/{pathparam1}/foo/bar/{pathparam2} </programlisting>
+<para>
+  Cannot be mapped as a <filename>web.xml</filename> URL pattern such as:
+</para>
+<programlisting>/*/foo/bar/*</programlisting>
+<para>
+  To work around this problem, use the following security annotations on your JAX-RS methods. You must also set up some general security constraint elements in <filename>web.xml</filename> to enable authentication.
+</para>
+<para>
+  RESTEasy JAX-RS supports the <literal>@RolesAllowed</literal>, <literal>@PermitAll</literal> and <literal>@DenyAll</literal> annotations on JAX-RS methods. By default, RESTEasy does not recognize these annotations. You must configure RESTEasy to enable role-based security by setting a context parameter, like so:
+</para>
+<note>
+  <para>
+    Do not enable this if you are using EJBs. The EJB container will provide this function instead of RESTEasy.
+  </para>  
+</note>
+<programlisting>
+&lt;![CDATA[
+&lt;web-app&gt;
+...
+   &lt;context-param&gt;
+      &lt;context-name&gt;resteasy.role.based.security&lt;/context-name&gt;
+      &lt;context-value&gt;true&lt;/context-value&gt;
+   &lt;/context-param&gt;
+&lt;/web-app>]]&gt;
+</programlisting>
+
+<para>
+    With this approach, you must declare all roles used within both the RESTEasy JAX-RS <filename>WAR</filename> file, and in your JAX-RS classes, and establish a security constraint that lets these roles access every URL handled by the JAX-RS runtime, assuming that RESTEasy authorizes correctly.
+</para>
+<para>
+    RESTEasy authorisation checks if a method is annotated with <literal>@RolesAllowed</literal> and then performs <literal>HttpServletRequest.isUserInRole</literal>. If one of the the <literal>@RolesAllowed</literal> passes, the request is allowed. If not, a response is returned with a <literal>401</literal> (Unauthorized) response code.
+</para>
+<para>
+    The following is an example of a modified RESTEasy WAR file. Note that every role declared is allowed access to every URL controlled by the RESTEasy Servlet.
+</para>
+<programlisting>
+
+&lt;web-app&gt;
+
+   &lt;context-param&gt;
+      &lt;context-name>resteasy.role.based.security&lt;/context-name&gt;
+      &lt;context-value>true&lt;/context-value&gt;
+   &lt;/context-param&gt;
+
+   &lt;listener&gt;
+      &lt;listener-class&gt;org.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
+   &lt;/listener&gt;
+
+   &lt;servlet&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;servlet-class&gt;org.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
+   &lt;/servlet&gt;
+
+   &lt;servlet-mapping&gt;
+      &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
+      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+   &lt;/servlet-mapping&gt;
+
+   &lt;security-constraint&gt;
+      &lt;web-resource-collection&gt;
+         &lt;web-resource-name&gt;Resteasy&lt;/web-resource-name&gt;
+         &lt;url-pattern&gt;/security&lt;/url-pattern&gt;
+      &lt;/web-resource-collection&gt;
+       &lt;auth-constraint&gt;
+         &lt;role-name&gt;admin&lt;/role-name&gt;
+         &lt;role-name&gt;user&lt;/role-name&gt;
+      &lt;/auth-constraint&gt;
+  &lt;/security-constraint&gt;
+
+   &lt;login-config&gt;
+      &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
+      &lt;realm-name&gt;Test&lt;/realm-name&gt;
+   &lt;/login-config&gt;
+
+   &lt;security-role&gt;
+      &lt;role-name&gt;admin&lt;/role-name&gt;
+   &lt;/security-role&gt;
+   &lt;security-role&gt;
+      &lt;role-name&gt;user&lt;/role-name&gt;
+   &lt;/security-role&gt;
+
+
+&lt;/web-app&gt;
+
+
+</programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/StringConverter.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/StringConverter.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/StringConverter.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,111 @@
+<chapter id="StringConverter">
+   <title>String marshalling for String based @*Param</title>
+   <para>
+      <literal>@PathParam</literal>, <literal>@QueryParam</literal>, <literal>@MatrixParam</literal>, <literal>@FormParam</literal>, and <literal>@HeaderParam</literal> are represented as Strings in a raw HTTP request. These injected parameter types can be converted into objects if they have a <literal>valueOf(String)</literal> static method, or a constructor that takes one String parameter. If you have a class with <literal>valueOf()</literal>, or the String constructor is inappropriate for your HTTP request, you can plug in RESTEasy's proprietary <literal>@Provider</literal>:
+   </para>
+   <programlisting>
+package org.jboss.resteasy.spi;
+
+public interface StringConverter&lt;T&gt;
+{
+   T fromString(String str);
+   String toString(T value);
+}
+   </programlisting>
+   <para>
+      This interface lets you use your own customized String marshalling. It is registered in <filename>web.xml</filename> under the <literal>resteasy.providers context-param</literal>. (See the Installation and Configuration chapter for details.) You can register it manually by calling the <literal>ResteasyProviderFactory.addStringConverter()</literal> method. A simple example of using the <literal>StringConverter</literal> follows:
+   </para>
+   <programlisting>
+   &lt;![CDATA[
+   import org.jboss.resteasy.client.ProxyFactory;
+   import org.jboss.resteasy.spi.StringConverter;
+   import org.jboss.resteasy.test.BaseResourceTest;
+   import org.junit.Assert;
+   import org.junit.Before;
+   import org.junit.Test;
+
+   import javax.ws.rs.HeaderParam;
+   import javax.ws.rs.MatrixParam;
+   import javax.ws.rs.PUT;
+   import javax.ws.rs.Path;
+   import javax.ws.rs.PathParam;
+   import javax.ws.rs.QueryParam;
+   import javax.ws.rs.ext.Provider;
+
+   public class StringConverterTest extends BaseResourceTest
+   {
+      public static class POJO
+      {
+         private String name;
+
+         public String getName()
+         {
+            return name;
+         }
+
+         public void setName(String name)
+         {
+            this.name = name;
+         }
+      }
+
+      @Provider
+      public static class POJOConverter implements StringConverter&lt;POJO&gt;
+      {
+         public POJO fromString(String str)
+         {
+            System.out.println("FROM STRNG: " + str);
+            POJO pojo = new POJO();
+            pojo.setName(str);
+            return pojo;
+         }
+
+         public String toString(POJO value)
+         {
+            return value.getName();
+         }
+      }
+
+      @Path("/")
+      public static class MyResource
+      {
+         @Path("{pojo}")
+         @PUT
+         public void put(@QueryParam("pojo")POJO q, @PathParam("pojo")POJO pp,
+                         @MatrixParam("pojo")POJO mp, @HeaderParam("pojo")POJO hp)
+         {
+            Assert.assertEquals(q.getName(), "pojo");
+            Assert.assertEquals(pp.getName(), "pojo");
+            Assert.assertEquals(mp.getName(), "pojo");
+            Assert.assertEquals(hp.getName(), "pojo");
+         }
+      }
+
+      @Before
+      public void setUp() throws Exception
+      {
+         dispatcher.getProviderFactory().addStringConverter(POJOConverter.class);
+         dispatcher.getRegistry().addPerRequestResource(MyResource.class);
+      }
+
+      @Path("/")
+      public static interface MyClient
+      {
+         @Path("{pojo}")
+         @PUT
+         void put(@QueryParam("pojo")POJO q, @PathParam("pojo")POJO pp,
+                  @MatrixParam("pojo")POJO mp, @HeaderParam("pojo")POJO hp);
+      }
+
+      @Test
+      public void testIt() throws Exception
+      {
+         MyClient client = ProxyFactory.create(MyClient.class, "http://localhost:8081");
+         POJO pojo = new POJO();
+         pojo.setName("pojo");
+         client.put(pojo, pojo, pojo, pojo);
+      }
+   }
+]]&gt;
+   </programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Using_Path.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Using_Path.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Using_Path.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,132 @@
+<chapter id="Using__Path_and__GET___POST__etc.">
+<title>Using @Path and @GET, @POST, etc.</title>
+
+<para>
+
+<programlisting>
+ at Path("/library")
+public class Library {
+
+   @GET
+   @Path("/books")
+   public String getBooks() {...}
+
+   @GET
+   @Path("/book/{isbn}")
+   public String getBook(@PathParam("isbn") String id) {
+      // search my database and get a string representation and return it
+   }
+
+   @PUT
+   @Path("/book/{isbn}")
+   public void addBook(@PathParam("isbn") String id, @QueryParam("name") String name) {...}
+
+   @DELETE
+   @Path("/book/{id}")
+   public void removeBook(@PathParam("id") String id {...}
+
+   
+}
+</programlisting>
+</para>
+<para>
+  If you have the RESTEasy Servlet configured and reachable at a root path of <literal>http://myhost.com/services</literal>, the requests would be handled by the <literal>Library</literal> class:
+</para>
+
+<itemizedlist>
+
+<listitem>
+  <para>
+    GET http://myhost.com/services/library/books
+  </para>
+</listitem>
+
+<listitem>
+  <para>
+    GET http://myhost.com/services/library/book/333
+  </para>
+</listitem>
+
+<listitem>
+  <para>
+    PUT http://myhost.com/services/library/book/333
+  </para>
+</listitem>
+
+<listitem>
+  <para>
+    DELETE http://myhost.com/services/library/book/333
+  </para>
+</listitem>
+
+</itemizedlist>
+
+<para>
+  The <literal>@javax.ws.rs.Path</literal> annotation must exist on either the class or a resource method, or both. If it exists on both the class and method, the relative path to the resource method is a concatenation of the class and method.
+</para>
+<para>
+  The <literal>@javax.ws.rs package</literal> contains annotations for each HTTP method. <literal>@GET</literal>, <literal>@POST</literal>, <literal>@PUT</literal>, <literal>@DELETE</literal>, and <literal>@HEAD</literal>. Place these annotations on public methods that you want to map to the annotation's HTTP method. If a <literal>@Path</literal> annotation exists on the class, you do not need to annotate the method you wish to map with <literal>@Path</literal>. Multiple HTTP methods can be used, as long as they can be distinguished from other methods.
+</para>
+<para>
+  When a method is annotated with <literal>@Path</literal> without a HTTP method being applied, the annotated method is referred to as a <literal>JAXRSResourceLocator</literal>.
+</para>
+
+<section id="_Path_and_regular_expression_mappings">
+<title>@Path and regular expression mappings</title>
+
+<para>
+  The <literal>@Path</literal> annotation is not limited to simple path expressions. You can also insert regular expressions into the value of <literal>@Path</literal>. For example:
+</para>
+<programlisting>
+ at Path("/resources)
+public class MyResource {
+
+   @GET
+   @Path("{var:.*}/stuff")
+   public String get() {...}
+}
+</programlisting>
+<para>
+  The following GETs will route to the <literal>getResource()</literal> method:
+</para>
+<programlisting>
+GET /resources/stuff
+GET /resources/foo/stuff
+GET /resources/on/and/on/stuff
+</programlisting>
+<para>
+  The format of the expression is:
+</para>
+<programlisting>
+"{" variable-name [ ":" regular-expression ] "}"
+</programlisting>
+<para>
+  Here, <literal>regular-expression</literal> is optional. Where this is not provided, the expression defaults to a wildcard matching of one particular segment, like so:
+</para>
+<programlisting>
+"([]*)"
+</programlisting>
+<para>
+For example:
+</para>
+<programlisting>
+
+ at Path(&quot;/resources/{var}/stuff&quot;)
+</programlisting>
+<para>
+will match these:
+</para>
+<programlisting>
+GET /resources/foo/stuff
+GET /resources/bar/stuff
+</programlisting>
+<para>
+
+but will not match:
+</para>
+
+<programlisting>
+GET /resources/a/bunch/of/stuff
+</programlisting>
+</section>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/Yaml.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/Yaml.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/Yaml.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,68 @@
+  <chapter id="Built_in_YAML_Provider">
+   <title>YAML Provider</title>
+
+   <para>
+      Since Beta 6, RESTEasy includes built-in support for YAML with the JYAML library. To enable YAML support, add the <filename>jyaml-1.3.jar</filename> to RESTEasy's classpath.
+   </para>
+   <para>
+      The JYAML <filename>JAR</filename> can be downloaded from <ulink url="https://sourceforge.net/project/showfiles.php?group_id=153924">SourceForge</ulink>.
+   </para>
+   <para>
+      If you use Maven, the JYAML <filename>JAR</filename> is available through the main repositories, and included with the following dependency:
+   </para>
+
+ <programlisting>
+ &lt;dependency&gt;
+&lt;groupId&gt;org.jyaml&lt;/groupId&gt;
+&lt;artifactId&gt;jyaml&lt;/artifactId&gt;
+&lt;version&gt;1.3&lt;/version&gt;
+ &lt;/dependency&gt;
+      </programlisting>
+   <para>
+      When starting up RESTEasy, watch the logs for a line stating that the <literal>YamlProvider</literal> has been added &#8212; this indicates that RESTEasy has located the JYAML <filename>JAR</filename>:
+   </para>
+   <screen>
+2877 Main INFO org.jboss.resteasy.plugins.providers.RegisterBuiltin - Adding YamlProvider
+   </screen>
+   <para>
+
+      The YAML provider recognises three MIME types:
+   </para>
+    <itemizedlist>
+
+	<listitem>
+	  <para><literal>text/x-yaml</literal></para>
+	</listitem>
+
+	<listitem>
+	  <para><literal>text/yaml</literal></para>
+	</listitem>
+
+	<listitem>
+	  <para><literal>application/x-yaml</literal></para>
+	</listitem>
+
+    </itemizedlist>
+   <para>
+      You can use YAML in a resource method like so:
+   </para>
+ <programlisting>
+ import javax.ws.rs.Consumes;
+ import javax.ws.rs.GET;
+ import javax.ws.rs.Path;
+ import javax.ws.rs.Produces;
+
+ @Path("/yaml")
+ public class YamlResource
+ {
+
+ at GET
+ at Produces("text/x-yaml")
+public MyObject getMyObject() {
+   return createMyObject();
+}
+...
+ }
+ </programlisting>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_Context.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_Context.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_Context.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,7 @@
+<chapter id="_Context">
+<title>@Context</title>
+
+<para>
+  The <literal>@Context</literal> annotation allows you to inject instances of <literal>javax.ws.rs.core.HttpHeaders</literal>, <literal>javax.ws.rs.core.UriInfo</literal>, <literal>javax.ws.rs.core.Request</literal>, <literal>javax.servlet.HttpServletRequest</literal>, <literal>javax.servlet.HttpServletResponse</literal>, <literal>javax.servlet.ServletConfig</literal>, <literal>javax.servlet.ServletContext</literal>, and <literal>javax.ws.rs.core.SecurityContext</literal> objects.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_CookieParam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_CookieParam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_CookieParam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,24 @@
+<chapter id="_CookieParam">
+<title>@CookieParam</title>
+
+<para>
+  The <literal>@CookieParam</literal> annotation allows you to inject the value of a cookie, or an object representation of an HTTP request cookie, into your method invocation.
+</para>
+<programlisting>
+  GET /books?num=5
+</programlisting>
+
+<programlisting>
+
+   @GET
+   public String getBooks(@CookieParam("sessionid") int id) {
+   ...
+   }
+
+   @GET
+   public String getBooks(@CookieParam("sessionid") javax.ws.rs.core.Cookie id) {...}
+</programlisting>
+<para>
+  As with <literal>@PathParam</literal>, the type of parameter can be a primitive, a String, or a class with a String constructor or static <literal>valueOf()</literal> method. You can also get an object representation of the cookie via the <literal>javax.ws.rs.core.Cookie</literal> class.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_DefaultValue.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_DefaultValue.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_DefaultValue.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,13 @@
+<chapter id="_DefaultValue">
+<title>@DefaultValue</title>
+
+<para>
+  <literal>@DefaultValue</literal> is a parameter annotation that can be combined with any other <literal>@<replaceable>*</replaceable>Param</literal> annotations to define a default value where the HTTP request item does not exist.
+</para>
+
+
+<programlisting>
+   @GET
+   public String getBooks(@QueryParam("num") @DefaultValue("10") int num) {...}
+</programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_Encoded_and_encoding.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_Encoded_and_encoding.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_Encoded_and_encoding.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,65 @@
+<chapter id="_Encoded_and_encoding">
+<title>@Encoded and encoding</title>
+
+<para>
+  JAX-RS allows you to get encoded or decoded <literal>@<replaceable>*</replaceable>Param</literal>s and specify path definitions and parameter names using encoded or decoded strings.
+</para>
+<para>
+  The <literal>@javax.ws.rs.Encoded</literal> annotation can be used on a class, method, or parameter. By default, injected <literal>@PathParam</literal> and <literal>@QueryParam</literal> are decoded. Adding the <literal>@Encoded</literal> annotation means that the value of these parameters will be provided in encoded form.
+</para>
+
+<programlisting>
+ at Path("/")
+public class MyResource {
+
+  @Path("/{param}")
+  @GET
+  public String get(@PathParam("param") @Encoded String param) {...}
+</programlisting>
+<para>
+  In the previous example, the value of the <literal>@PathParam</literal> injected into the <literal>param</literal> of the <literal>get()</literal> method will be URL encoded. Adding the <literal>@Encoded</literal> annotation as a parameter annotation triggers this effect.
+</para>
+<para>
+  You can also use the <literal>@Encoded</literal> annotation on the entire method and any combination of <literal>@QueryParam</literal> or <literal>@PathParam</literal>'s values will be encoded.
+</para>
+
+<programlisting>
+ at Path("/")
+public class MyResource {
+  
+   @Path("/{param}")
+   @GET
+   @Encoded
+   public String get(@QueryParam("foo") String foo, @PathParam("param") String param) {}
+}
+
+
+</programlisting>
+<para>
+  In this example, the values of the <literal>foo</literal> query parameter and the <literal>param</literal> path parameter will be injected as encoded values.
+</para>
+<para>
+  You can also set the default to be encoded for the entire class.
+<programlisting>
+ at Path("/")
+ at Encoded
+public class ClassEncoded {
+  
+   @GET
+   public String get(@QueryParam("foo") String foo) {}
+}
+</programlisting>
+<para>
+  The <literal>@Path</literal> annotation has an attribute called <emphasis>encode</emphasis>. This controls whether the literal part of the value supplied (that is, the characters that are not part of a template variable) are URL-encoded. If <literal>true</literal>, any characters in the URI template that are not valid will be automatically encoded. If <literal>false</literal>, then all characters must be valid URI characters. By default, the <literal>encode</literal> attribute is set to <literal>true</literal>. (You can also encode the characters by hand.)
+</para>
+<programlisting>
+ at Path(value="hello%20world", encode=false)
+</programlisting>
+<para>
+  As with <literal>@Path.encode()</literal>, this controls whether the specified query parameter name should be encoded by the container before it tries to find the query parameter in the request.
+</para>
+
+<programlisting>
+ at QueryParam(value="hello%20world", encode=false)
+</programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_Form.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_Form.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_Form.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,34 @@
+<chapter id="_Form">
+<title>@Form</title>
+
+<para>
+  This is a RESTEasy-specific annotation that allows you to reuse any <literal>@<replaceable>*</replaceable>Param</literal> annotation within an injected class. RESTEasy instantiates the class and injects values into any annotated <literal>@<replaceable>*</replaceable>Param</literal> or <literal>@Context</literal> property. This is useful if you have many parameters on your method and you want to condense them into a value object.
+</para>
+
+<programlisting>
+public class MyForm {
+
+   @FormParam("stuff")
+   private int stuff;
+
+
+   @HeaderParam("myHeader")
+   private String header;
+
+
+   @PathParam("foo")
+   public void setFoo(String foo) {...}
+}
+
+
+
+ at POST
+ at Path("/myservice")
+public void post(@Form MyForm form) {...}
+</programlisting>
+
+<para>
+  When someone posts to <literal>/myservice</literal>, RESTEasy instantiates an instance of <literal>MyForm</literal> and injects the form parameter <literal>stuff</literal> into the <literal>stuff</literal> field, the header <literal>myheader</literal> into the <literal>header</literal> field, and call the <literal>setFoo</literal> method with the <literal>@PathParam</literal> variable of <literal>foo</literal>.
+</para>
+
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_FormParam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_FormParam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_FormParam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,50 @@
+<chapter id="_FormParam">
+<title>@FormParam</title>
+
+<para>
+  When the input request body is of the type <literal>application/x-www-form-urlencoded</literal> (that is, an HTML form), you can inject individual form parameters from the request body into method parameter values.
+</para>
+
+<programlisting>
+&lt;form method="POST" action="/resources/service"&gt;
+First name: 
+&lt;input type="text" name="firstname"&gt;
+&lt;br&gt;
+Last name: 
+&lt;input type="text" name="lastname"&gt;
+&lt;/form&gt;
+</programlisting>
+
+<para>
+  If you post using this form, the service would look as follows:
+</para>
+
+<programlisting>
+ at Path("/")
+public class NameRegistry {
+
+   @Path("/resources/service")
+   @POST
+   public void addName(@FormParam("firstname") String first, @FormParam("lastname") String last) {...}
+
+</programlisting>
+<para>
+  You cannot combine <literal>@FormParam</literal> with the default <literal>application/x-www-form-urlencoded</literal> that unmarshalls to a <literal>MultivaluedMap&lt;String, String&gt;</literal> That is, the following would be illegal:
+</para>
+
+<programlisting>
+ at Path("/")
+public class NameRegistry {
+
+   @Path("/resources/service")
+   @POST
+   @Consumes("application/x-www-form-urlencoded")
+   public void addName(@FormParam("firstname") String first, MultivaluedMap&lt;String, String&gt; form) {...}
+
+</programlisting>
+
+<para>
+
+
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_HeaderParam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_HeaderParam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_HeaderParam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,26 @@
+<chapter id="_HeaderParam">
+<title>@HeaderParam</title>
+
+<para>
+  The <literal>@HeaderParam</literal> annotation allows you to map a request HTTP header onto your method invocation.
+</para>
+<programlisting>
+  GET /books?num=5
+</programlisting>
+
+<programlisting>
+   
+   @GET
+   public String getBooks(@HeaderParam("From") String from) {
+   ...
+   }
+</programlisting>
+<para>
+  As with <literal>@PathParam</literal>, the type of parameter can be a primitive, a String, or a class with a String constructor or static <literal>valueOf()</literal> method. For example, <literal>MediaType</literal> has a <literal>valueOf()</literal> method, so you could do the following:
+</para>
+<programlisting>
+
+   @PUT
+   public void put(@HeaderParam("Content-Type") MediaType contentType, ...)
+</programlisting>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_MatrixParam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_MatrixParam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_MatrixParam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,23 @@
+<chapter id="_MatrixParam">
+<title>@MatrixParam</title>
+
+<para>
+  Matrix parameters are an arbitrary set of name-value pairs embedded in a URI path segment. An example of a matrix parameter is:
+</para>
+<programlisting>
+
+GET http://host.com/library/book;name=EJB 3.0;author=Bill Burke
+</programlisting>
+<para>
+  Matrix parameters represent resources that can be addressed by their attributes as well as their raw ID. The <literal>@MatrixParam</literal> annotation lets you injext URI matrix parameters into your method invocation.
+</para>
+
+<programlisting>
+
+   @GET
+   public String getBook(@MatrixParam("name") String name, @MatrixParam("author") String author) {...}
+</programlisting>
+<para>
+  One limitation with <literal>@MatrixParam</literal> is that the current version of the specification does not resolve. If, for example, the same <literal>MatrixParam</literal> exists simultaneously in different path segments, at present we recommend using <literal>PathParam</literal> combined with <literal>PathSegment</literal>.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_PathParam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_PathParam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_PathParam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,133 @@
+<chapter id="_PathParam">
+<title>@PathParam</title>
+
+<para>
+  <literal>@PathParam</literal> is a parameter annotation which allows you to map variable URI path fragments into your method call.
+</para>
+
+<programlisting>
+ at Path("/library")
+public class Library {
+
+   @GET
+   @Path("/book/{isbn}")
+   public String getBook(@PathParam("isbn") String id) {
+      // search my database and get a string representation and return it
+   }
+}
+</programlisting>
+<para>
+  This lets you embed variable identification in the URIs of your resources. The previous example shows an <literal>isbn</literal> URI parameter passing information about a particular book we want to access. You can inject into any primitive parameter type, a String, any Java object that takes a String parameter, or a static <literal>valueOf</literal> method that takes a String parameter. For example, if we wanted <literal>isbn</literal> to be a real object, we could write:
+</para>
+
+<programlisting>
+
+   @GET
+   @Path("/book/{isbn}")
+   public String getBook(@PathParam("isbn") ISBN id) {...}
+
+
+   public class ISBN {
+      public ISBN(String str) {...}
+   }
+
+</programlisting>
+<para>
+Or instead of a public String constructor, we could have a <literal>valueOf</literal> method:
+</para>
+
+<programlisting>
+  public class ISBN {
+     
+     public static ISBN valueOf(String isbn) {...}
+  }
+</programlisting>
+
+
+
+<section id="Advanced__PathParam_and_Regular_Expressions">
+<title>Advanced @PathParam and Regular Expressions</title>
+
+<para>
+  There are several more complicated uses of <literal>@PathParam</literal>s.
+</para>
+<para>
+  You are allowed to specify one or more <literal>@PathParam</literal>s embedded in one URI segment. For example:
+</para>
+<para>
+
+<programlisting>
+1. @Path("/aaa{param}bbb")
+2. @Path("/{name}-{zip}")
+3. @Path("/foo{name}-{zip}bar")
+</programlisting>
+</para>
+<para>
+  So, a URI of the form &quot;/aaa111bbb&quot; would match the first specified parameter. &quot;/bill-02115&quot; would match the second, and &quot;foobill-02115bar&quot; would match the third.
+</para>
+<para>
+  In <xref linkend="_Path_and_regular_expression_mappings" />, we mentioned that regular expressions can be used within <literal>@Path</literal> values, like so:
+</para>
+<programlisting>
+
+ at GET
+ at Path("/aaa{param:b+}/{many:.*}/stuff")
+public String getIt(@PathParam("param") String bs, @PathParam("many") String many) {...}
+
+</programlisting>
+
+<para>
+  With the <literal>@Path</literal> defined here, the request <literal>GET /aaabb/some/stuff</literal> would have a <literal>&quot;param&quot;</literal> value of <literal>bb</literal>, and a <literal>&quot;many&quot;</literal> value of <literal>some</literal>. The request <literal>GET /aaab/a/lot/of/stuff</literal> would have a <literal>&quot;param&quot;</literal> value of <literal>b</literal>, and a <literal>&quot;many&quot;</literal> value of <literal>a/lot/of</literal>.
+</para>
+</section>
+
+<section id="_PathParam_and_PathSegment">
+<title>@PathParam and PathSegment</title>
+
+<para>
+  The specification has a very simple abstraction for examining a fragment of the URI path being invoked on <literal>javax.ws.rs.core.PathSegment</literal>:
+</para>
+
+<programlisting>
+
+public interface PathSegment {
+
+    /**
+     * Get the path segment.
+     * &lt;p&gt;
+     * @return the path segment
+     */
+    String getPath();
+    /**
+     * Get a map of the matrix parameters associated with the path segment
+     * @return the map of matrix parameters
+     */
+    MultivaluedMap&lt;String, String&gt; getMatrixParameters();
+    
+}
+
+</programlisting>
+<para>
+  RESTEasy can inject a <literal>PathSegment</literal> instead of a value with your <literal>@PathParam</literal>.
+</para>
+<programlisting>
+   @GET
+   @Path("/book/{id}")
+   public String getBook(@PathParam("id") PathSegment id) {...}
+
+</programlisting>
+<para>
+  This is particularly useful when you have multiple <literal>@PathParam</literal>s that use <emphasis>matrix parameters</emphasis>. Matrix parameters are an arbitrary set of name-value pairs embedded in a URI path segment. The <literal>PathSegment</literal> object fives you access to these parameters. See <xref linkend="_MatrixParam" /> for further information.
+</para>
+<para>
+  An example of a matrix parameter:
+</para>
+<programlisting>
+  GET http://host.com/library/book;name=EJB 3.0;author=Bill Burke
+</programlisting>
+<para>
+  A matrix parameter represents a resource that can be addressed by its attributes as well as its raw ID.
+</para>
+</section>
+</chapter>
+

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/_QueryParam.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/_QueryParam.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/_QueryParam.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,22 @@
+<chapter id="_QueryParam">
+<title>@QueryParam</title>
+
+<para>
+
+The @QueryParam annotation allows you to map a URI query string parameter or URL form-encoded parameter onto your method invocation.
+</para>
+<programlisting>
+  GET /books?num=5
+</programlisting>
+
+<programlisting>
+
+   @GET
+   public String getBooks(@QueryParam("num") int num) {
+   ...
+   }
+</programlisting>
+<para>
+  Since RESTEasy is built on a Servlet, it cannot distinguish between URL query strings and URL form-encoded parameters. As with <literal>@PathParam</literal>, the type of parameter can be a primitive, a String, or a class with a String constructor or static <literal>valueOf()</literal> method.
+</para>
+</chapter>

Added: projects/docs/enterprise/5.0/RESTEasy/en-US/gzip.xml
===================================================================
--- projects/docs/enterprise/5.0/RESTEasy/en-US/gzip.xml	                        (rev 0)
+++ projects/docs/enterprise/5.0/RESTEasy/en-US/gzip.xml	2009-07-30 22:41:35 UTC (rev 91848)
@@ -0,0 +1,31 @@
+<chapter id="gzip">
+   <title>GZIP Compression/Decompression</title>
+   <para>
+      RESTEasy has automatic GZIP decompression support. If the client framework or a JAX-RS service receives a message body with a <literal>Content-Encoding</literal> of <literal>gzip</literal>, the message will be automatically decompressed. The client framework also sets the <literal>Accept-Encoding</literal> header to <literal>gzip, deflate</literal> automatically.
+    </para>
+    <para>
+      RESTEasy also supports automatic compression. If a request or response with a <literal>Content-Encoding</literal> header of <literal>gzip</literal> is sent or received, RESTEasy performs the compression. You can use the <literal>@org.jboss.resteasy.annotation.GZIP</literal> annotation if you do not want to set each <literal>Content-Encoding</literal> manually.
+   </para>
+<programlisting>
+ at Path("/")
+public interface MyProxy {
+
+   @Consumes("application/xml")
+   @PUT
+   public void put(@GZIP Order order);
+}
+</programlisting>
+   <para>
+      Here, the <literal>order</literal> message body is tagged for GZIP compression. You can use the same annotation to tag server responses:
+   </para>
+<programlisting>
+ at Path("/")
+public class MyService {
+
+   @GET
+   @Produces("application/xml")
+   @GZIP
+   public String getData() {...}
+}
+</programlisting>
+</chapter>




More information about the jboss-cvs-commits mailing list