You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wink.apache.org by el...@apache.org on 2009/11/11 08:39:50 UTC

svn commit: r834791 [5/8] - in /incubator/wink/site/trunk/src/site: apt/ resources/1.0/html/ resources/1.0/html/attachments/ resources/1.0/html/attachments/2328628/ resources/1.0/html/attachments/2328642/ resources/1.0/html/attachments/2329360/ resourc...

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix A - Feeds Support.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix%20A%20-%20Feeds%20Support.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix A - Feeds Support.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix A - Feeds Support.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,648 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : Appendix A - Feeds Support</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : Appendix A - Feeds Support
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Oct 15, 2009 by <font color="#0050B2">shivakumar</font>.
+				    </div>
+
+				    <h1><a name="AppendixA-FeedsSupport-MigrationfromApacheAbderatoApacheWink"></a>Migration from Apache Abdera to Apache Wink</h1>
+
+<p>Apache Wink is an excellent solution for consuming and producing Atom, APP and RSS documents. The following section describes how to migrate from Apache Abdera to Apache Wink by providing a set of examples that cover most use cases.</p>
+
+<h3><a name="AppendixA-FeedsSupport-AdvantagesofApacheWinkoverApacheAbdera"></a>Advantages of Apache Wink over Apache Abdera</h3>
+<ul>
+	<li>Standardized APIs (using JAX-RS and JAXB)</li>
+	<li>Support for handling XML and JSON more easily</li>
+	<li>Support for handling RSS and ATOM more easily</li>
+</ul>
+
+
+<h3><a name="AppendixA-FeedsSupport-Thissectioncontainsthefollowingtopics%3A"></a>This section contains the following topics:</h3>
+<ul>
+	<li><a href="#AppendixA-FeedsSupport-1%29ConsumingAtomDocuments">1&#41; Consuming Atom Documents</a></li>
+	<li><a href="#AppendixA-FeedsSupport-2%29a%29ProducingAtomDocuments">2&#41; a&#41; Producing Atom Documents</a></li>
+	<li><a href="#AppendixA-FeedsSupport-2%29b%29ProducingAtomDocumentstheJAXRSway">2&#41; b&#41; Producing Atom Documents &#45; the JAX&#45;RS way</a></li>
+	<li><a href="#AppendixA-FeedsSupport-3%29ConsumingRSSDocuments">3&#41; Consuming RSS Documents</a></li>
+	<li><a href="#AppendixA-FeedsSupport-4%29ProducingRSSDocuments">4&#41; Producing RSS Documents</a></li>
+	<li><a href="#AppendixA-FeedsSupport-5%29WritingAtomPublishingProtocol%28APP%29Server">5&#41; Writing Atom Publishing Protocol &#40;APP&#41; Server</a></li>
+	<li><a href="#AppendixA-FeedsSupport-6%29WritingAtomPublishingProtocol%28APP%29Client">6&#41; Writing Atom Publishing Protocol &#40;APP&#41; Client</a></li>
+</ul>
+
+
+<hr />
+<h3><a name="AppendixA-FeedsSupport-1%29ConsumingAtomDocuments"></a>1) Consuming Atom Documents</h3>
+<p>The following code example demonstrates the consumption of Atom documents using Apache Abdera.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Abdera - Click on link to Download - <a href="attachments/2852765/3113129.java">ConsumeAtomUsingAbdera.java</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Abdera abdera = <span class="code-keyword">new</span> Abdera();
+Parser parser = abdera.getParser();
+URL url = <span class="code-keyword">new</span> URL(<span class="code-quote">"http:<span class="code-comment">//alexharden.org/blog/atom.xml"</span>);
+</span>Document&lt;Feed&gt; doc = parser.parse(url.openStream());
+Feed feed = doc.getRoot();
+<span class="code-object">System</span>.out.println(feed.getTitle());
+<span class="code-keyword">for</span> (Entry entry : feed.getEntries()) {
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"\t"</span> + entry.getTitle());
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+<p>The following code example demonstrates the consumption of Atom documents using Apache Wink.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Wink  - Click on link to Download - <a href="attachments/2852765/3113127.java">ConsumeAtomUsingWink.java</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+RestClient client = <span class="code-keyword">new</span> RestClient();
+Resource resource = client.resource(<span class="code-quote">"http:<span class="code-comment">//alexharden.org/blog/atom.xml"</span>);
+</span>AtomFeed feed = resource.accept(MediaType.APPLICATION_ATOM_XML).get(AtomFeed.class);
+<span class="code-object">System</span>.out.println(feed.getTitle().getValue());
+<span class="code-keyword">for</span> (AtomEntry entry : feed.getEntries()) {
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"\t"</span> + entry.getTitle().getValue());
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+<hr />
+<h3><a name="AppendixA-FeedsSupport-2%29a%29ProducingAtomDocuments"></a>2) a) Producing Atom Documents</h3>
+<p>The following code example demonstrates the production of Atom documents using Apache Abdera.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Abdera  - Click on links to Download - <a href="attachments/2852765/3113130.java">ProduceAtomUsingAbdera.java</a> <a href="attachments/2852765/3113128.xml">ProduceAtomUsingAbdera_web.xml</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">protected</span> void doGet(HttpServletRequest request, HttpServletResponse response)
+    <span class="code-keyword">throws</span> ServletException, IOException {
+    Abdera abdera = <span class="code-keyword">new</span> Abdera();
+    Feed feed = abdera.newFeed();
+
+    feed.setId(<span class="code-quote">"tag:example.org,2007:/foo"</span>);
+    feed.setTitle(<span class="code-quote">"Test Feed"</span>);
+    feed.setSubtitle(<span class="code-quote">"Feed subtitle"</span>);
+    feed.setUpdated(<span class="code-keyword">new</span> Date());
+    feed.addAuthor(<span class="code-quote">"Shiva HR"</span>);
+    feed.addLink(<span class="code-quote">"http:<span class="code-comment">//example.com"</span>);
+</span>    feed.addLink(<span class="code-quote">"http:<span class="code-comment">//example.com/foo"</span>, <span class="code-quote">"self"</span>);
+</span>
+    Entry entry = feed.addEntry();
+    entry.setId(<span class="code-quote">"tag:example.org,2007:/foo/entries/1"</span>);
+    entry.setTitle(<span class="code-quote">"Entry title"</span>);
+    entry.setSummaryAsHtml(<span class="code-quote">"&lt;p&gt;This is the entry title&lt;/p&gt;"</span>);
+    entry.setUpdated(<span class="code-keyword">new</span> Date());
+    entry.setPublished(<span class="code-keyword">new</span> Date());
+    entry.addLink(<span class="code-quote">"http:<span class="code-comment">//example.com/foo/entries/1"</span>);
+</span>
+    feed.getDocument().writeTo(response.getWriter());
+} </pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+
+<p>The following code example demonstrates the production of Atom documents using Apache Wink.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Wink  - Click on links to Download - <a href="attachments/2852765/3113134.java">ProduceAtomUsingWink.java</a> <a href="attachments/2852765/3113132.xml">ProduceAtomUsingWink_web.xml</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">protected</span> void doGet(HttpServletRequest request, HttpServletResponse response)
+    <span class="code-keyword">throws</span> ServletException, IOException {
+    AtomFeed feed = <span class="code-keyword">new</span> AtomFeed();
+    feed.setId(<span class="code-quote">"tag:example.org,2007:/foo"</span>);
+    feed.setTitle(<span class="code-keyword">new</span> AtomText(<span class="code-quote">"Test Feed"</span>));
+    feed.setSubtitle(<span class="code-keyword">new</span> AtomText(<span class="code-quote">"Feed subtitle"</span>));
+    feed.setUpdated(<span class="code-keyword">new</span> Date());
+
+    AtomPerson person = <span class="code-keyword">new</span> AtomPerson();
+    person.setName(<span class="code-quote">"Shiva HR"</span>);
+    feed.getAuthors().add(person);
+
+    AtomLink link1 = <span class="code-keyword">new</span> AtomLink();
+    link1.setHref(<span class="code-quote">"http:<span class="code-comment">//example.com"</span>);
+</span>    feed.getLinks().add(link1);
+
+    AtomLink link2 = <span class="code-keyword">new</span> AtomLink();
+    link2.setHref(<span class="code-quote">"http:<span class="code-comment">//example.com/foo"</span>);
+</span>    link2.setRel(<span class="code-quote">"self"</span>);
+    feed.getLinks().add(link2);
+
+    AtomEntry entry = <span class="code-keyword">new</span> AtomEntry();
+    entry.setId(<span class="code-quote">"tag:example.org,2007:/foo/entries/1"</span>);
+    entry.setTitle(<span class="code-keyword">new</span> AtomText(<span class="code-quote">"Entry title"</span>));
+
+    AtomText summary = <span class="code-keyword">new</span> AtomText();
+    summary.setType(AtomTextType.html);
+    summary.setValue(<span class="code-quote">"&lt;p&gt;This is the entry title&lt;/p&gt;"</span>);
+    entry.setSummary(summary);
+
+    entry.setUpdated(<span class="code-keyword">new</span> Date());
+    entry.setPublished(<span class="code-keyword">new</span> Date());
+
+    AtomLink link3 = <span class="code-keyword">new</span> AtomLink();
+    link3.setHref(<span class="code-quote">"http:<span class="code-comment">//example.com/foo/entries/1"</span>);
+</span>    entry.getLinks().add(link3);
+
+    feed.getEntries().add(entry);
+
+    AtomFeed.marshal(feed, response.getOutputStream());
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+
+<h3><a name="AppendixA-FeedsSupport-2%29b%29ProducingAtomDocumentstheJAXRSway"></a>2) b) Producing Atom Documents - the JAX-RS way</h3>
+<p>A more elegant way of producing Atom documents using Apache Wink is the JAX-RS way as described below:</p>
+
+<h4><a name="AppendixA-FeedsSupport-"></a></h4>
+
+<ol>
+	<li>Open the Eclipse development environment and create a "Dynamic Web Project".</li>
+	<li>Add Apache Wink &amp; its dependent JARs under Java EE Module Dependencies.</li>
+	<li>Create a POJO class and a method that creates Atom feed document. Annotate the class &amp; its methods with the required JAX-RS annotations as below:<br/>
+<a href="attachments/2852765/3113135.java">ProduceAtom.java</a></li>
+	<li>Add org.apache.wink.server.internal.servlet.RestServlet into web.xml and specify the path of above Resource class in it's init-param.<br/>
+See <a href="attachments/2852765/3113133.xml">ProduceAtomWinkElegant_web.xml</a> and <a href="attachments/2852765/3113131">application</a></li>
+	<li>Deploy the web-application and access it using the url <a href="http://localhost:8080/ProduceAtom_Wink_Elegant/rest/getAtom">http://localhost:8080/ProduceAtom_Wink_Elegant/rest/getAtom</a></li>
+	<li>Final WAR &#45;&gt; <a href="attachments/2852765/3113138.zip">ProduceAtom_Wink_Elegant.zip</a> (add Wink &amp; its dependent JARs under ProduceAtom_Wink_Elegant\WEB-INF\lib and re-zip it as WAR).</li>
+</ol>
+
+
+<hr />
+<h3><a name="AppendixA-FeedsSupport-3%29ConsumingRSSDocuments"></a>3) Consuming RSS Documents</h3>
+
+<p>The following code example demonstrates the consuming of RSS documents using Apache Abdera.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Abdera  - Click on link to Download - <a href="attachments/2852765/3113136.java">ConsumeRssUsingAbdera.java</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">public</span> <span class="code-keyword">static</span> void main(<span class="code-object">String</span>[] args) <span class="code-keyword">throws</span> ParseException, IOException {
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"Consuming RSS Documents using Abdera...\n"</span>);
+    Abdera abdera = <span class="code-keyword">new</span> Abdera();
+    Parser parser = abdera.getParser();
+    URL url = <span class="code-keyword">new</span> URL(<span class="code-quote">"http:<span class="code-comment">//www.rssboard.org/files/sample-rss-2.xml"</span>);
+</span>    Document&lt;RssFeed&gt; doc = parser.parse(url.openStream());
+    RssFeed rssFeed = doc.getRoot();
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"Title: "</span> + rssFeed.getTitle());
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"Description: "</span> + rssFeed.getSubtitle() + <span class="code-quote">"\n"</span>);
+    <span class="code-object">int</span> itemCount = 0;
+    <span class="code-keyword">for</span> (Entry entry : rssFeed.getEntries()) {
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"Item "</span> + ++itemCount + <span class="code-quote">":"</span>);
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\tTitle: "</span> + entry.getTitle());
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\tPublish Date: "</span> + entry.getPublished());
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\tDescription: "</span> + entry.getContent());
+    }
+} </pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+<p>The following code example demonstrates the consuming of RSS documents using Apache Wink.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Wink  - Click on link to Download - <a href="attachments/2852765/3113139.java">ConsumeRssUsingWink.java</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">public</span> <span class="code-keyword">static</span> void main(<span class="code-object">String</span>[] args) {
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"Consuming RSS Documents using Apache Wink...\n"</span>);
+    RestClient client = <span class="code-keyword">new</span> RestClient();
+    <span class="code-object">String</span> url = <span class="code-quote">"http:<span class="code-comment">//www.rssboard.org/files/sample-rss-2.xml"</span>;
+</span>    Resource resource = client.resource(url);
+    RssFeed rss = resource.accept(MediaType.APPLICATION_XML).get(RssFeed.class);
+    RssChannel channel = rss.getChannel();
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"Title: "</span> + channel.getTitle());
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"Description: "</span> + channel.getDescription() + <span class="code-quote">"\n"</span>);
+    <span class="code-object">int</span> itemCount = 0;
+    <span class="code-keyword">for</span> (RssItem item : channel.getItems()) {
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"Item "</span> + ++itemCount + <span class="code-quote">":"</span>);
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\tTitle: "</span> + item.getTitle());
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\tPublish Date: "</span> + item.getPubDate());
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\tDescription: "</span> + item.getDescription());
+    }
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+<hr />
+<h3><a name="AppendixA-FeedsSupport-4%29ProducingRSSDocuments"></a>4) Producing RSS Documents</h3>
+
+<h4><a name="AppendixA-FeedsSupport-ApacheAbdera"></a>Apache Abdera</h4>
+<p>Apache Abdera version 0.4 does not support RSS write.</p>
+
+<h4><a name="AppendixA-FeedsSupport-ApacheWink"></a>Apache Wink</h4>
+<p>Same as in <a href="#AppendixA-FeedsSupport-2%29b%29ProducingAtomDocumentstheJAXRSway">2&#41; b&#41; Producing Atom Documents &#45; the JAX&#45;RS way</a>. However the resource method now returns an RssFeed object instead of AtomFeed object.</p>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Wink  - Click on link to Download - <a href="attachments/2852765/3113137.zip">ProduceRss_Wink_Elegant.zip</a> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+@Path(<span class="code-quote">"/getRss"</span>)
+<span class="code-keyword">public</span> class ProduceRss {
+    @GET
+    @Produces(MediaType.APPLICATION_XML)
+    <span class="code-keyword">public</span> Rss getRss() {
+        RssFeed rss = <span class="code-keyword">new</span> RssFeed();
+
+        RssChannel channel = <span class="code-keyword">new</span> RssChannel();
+        channel.setTitle(<span class="code-quote">"Liftoff News"</span>);
+        channel.setLink(<span class="code-quote">"http:<span class="code-comment">//liftoff.msfc.nasa.gov"</span>);
+</span>        channel.setDescription(<span class="code-quote">"Liftoff to Space Exploration."</span>);
+        channel.setPubDate(<span class="code-keyword">new</span> Date().toString());
+
+        RssItem item = <span class="code-keyword">new</span> RssItem();
+        item.setTitle(<span class="code-quote">"Star City"</span>);
+        item.setLink(<span class="code-quote">"http:<span class="code-comment">//liftoff.msfc.nasa.gov/news/2003/news-starcity.asp"</span>);
+</span>        item.setDescription(<span class="code-quote">"How <span class="code-keyword">do</span> Americans get ready to work with Russians aboard the International Space Station?"</span>);
+
+        channel.getItem().add(item);
+        rss.setChannel(channel);
+        <span class="code-keyword">return</span> rss;
+    }
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+<hr />
+<h3><a name="AppendixA-FeedsSupport-5%29WritingAtomPublishingProtocol%28APP%29Server"></a>5) Writing Atom Publishing Protocol (APP) Server</h3>
+<p>The following steps explain how to implement an APP server as described in the following beautiful article by James Snell: <a href="http://www.ibm.com/developerworks/library/x-atompp1/">http://www.ibm.com/developerworks/library/x-atompp1/</a></p>
+
+<h4><a name="AppendixA-FeedsSupport-ApacheAbdera"></a>Apache Abdera</h4>
+
+<ol>
+	<li>Open the Eclipse development environment and create a "Dynamic Web Project".</li>
+	<li>Add Apache Abdera &amp; its dependent JARs under Java EE Module Dependencies.</li>
+	<li>Add the following CollectionAdapter and Provider classes under src/myPackage directory: <a href="attachments/2852765/4456457.java">APP_CollectionAdapter.java</a> <a href="attachments/2852765/4456455.java">APP_ContentProvider.java</a></li>
+	<li>Add org.apache.abdera.protocol.server.servlet.AbderaServlet into web.xml and point the following init paramters to the classes added above.
+<br clear="all" />
+org.apache.abdera.protocol.server.Provider
+<br clear="all" />
+org.apache.abdera.protocol.server.CollectionAdapter
+<br clear="all" />
+<a href="attachments/2852765/4456456.xml">APP_Server_Abdera_web.xml</a></li>
+	<li>Add the following index.jsp which has help on how to perform the APP operations: <a href="attachments/2852765/4456458.jsp">APP_Server_Abdera_index.jsp</a></li>
+	<li>Deploy and run the application.</li>
+</ol>
+
+
+<p>Final WAR &#45;&gt; <a href="attachments/2852765/4456454.zip">APP_Server_Abdera.zip</a> (add Apache Abdera &amp; its dependent JARs under APP_Server_Abdera\WEB-INF\lib and re-zip it as WAR).</p>
+
+<h4><a name="AppendixA-FeedsSupport-ApacheWink"></a>Apache Wink</h4>
+
+<ol>
+	<li>Open the Eclipse development environment and create a "Dynamic Web Project".</li>
+	<li>Add Apache Wink &amp; its dependent JARs under Java EE Module Dependencies.</li>
+	<li>Add the following Resource class under src/myPackage directory: <a href="attachments/2852765/4456460.java">EntriesCollection.java</a></li>
+	<li>Add org.apache.wink.server.internal.servlet.RestServlet into web.xml and specify the path of above Resource class in it's init-param. <a href="attachments/2852765/4456462.xml">APP_Server_Wink_web.xml</a> <a href="attachments/2852765/4456461">APP_Server_Wink_application</a></li>
+	<li>Add the following index.jsp which has help on how to perform the APP operations: <a href="attachments/2852765/4456459.jsp">APP_Server_Wink_index.jsp</a></li>
+	<li>Deploy and run the application.</li>
+</ol>
+
+
+<p>Final WAR &#45;&gt; <a href="attachments/2852765/4456452.zip">APP_Server_Wink.zip</a> (add Apache Wink &amp; its dependent JARs under APP_Server_Wink\WEB-INF\lib and re-zip it as WAR)</p>
+
+<h4><a name="AppendixA-FeedsSupport-References"></a>References</h4>
+
+<ul>
+	<li>Apache Wink's "SimpleDefects" example: <a href="http://svn.apache.org/repos/asf/incubator/wink/tags/wink-0.1-incubating/wink-examples/apps/SimpleDefects/src/main/java/org/apache/wink/example/simpledefects/resources/DefectsResource.java">http://svn.apache.org/repos/asf/incubator/wink/tags/wink-0.1-incubating/wink-examples/apps/SimpleDefects/src/main/java/org/apache/wink/example/simpledefects/resources/DefectsResource.java</a></li>
+	<li>Abdera Feed Sample shipped with IBM WebSphere Feature Pack for Web 2.0 <a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.ajax.feed.samples.help/docs/GettingStarted_useage.html">http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.ajax.feed.samples.help/docs/GettingStarted_useage.html</a></li>
+	<li>Abdera Server Implementation Guide &#45;&gt; <a href="http://cwiki.apache.org/ABDERA/server-implementation-guide.html">http://cwiki.apache.org/ABDERA/server-implementation-guide.html</a></li>
+	<li>Abdera Collection Adapter Implementation Guide &#45;&gt; <a href="http://cwiki.apache.org/ABDERA/collection-adapter-implementation-guide.html">http://cwiki.apache.org/ABDERA/collection-adapter-implementation-guide.html</a></li>
+</ul>
+
+
+<hr />
+<h3><a name="AppendixA-FeedsSupport-6%29WritingAtomPublishingProtocol%28APP%29Client"></a>6) Writing Atom Publishing Protocol (APP) Client</h3>
+
+<p>In order to write an Atom Publishing Protocol client refer to the following examples.</p>
+
+<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Important Note</b><br />Make sure that the APP_Server_Abdera.war and the APP_Server_Wink.war provided in the previous example are deployed before running these examples.</td></tr></table></div>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Abdera - Click on link to Download - <a href="attachments/2852765/4751362.java">APP_Client_Abdera.java</a><br clear="all" /> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 1. Acessing Service Document: <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Document&lt;Service&gt; introspection = abderaClient.get(SERVICE_URL).getDocument();
+Service service = introspection.getRoot();
+List&lt;Workspace&gt; workspaces = service.getWorkspaces();
+<span class="code-keyword">for</span> (Workspace workspace : workspaces) {
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"\t"</span> + workspace.getTitle());
+    List&lt;Collection&gt; collections = workspace.getCollections();
+    <span class="code-keyword">for</span> (Collection collection : collections) {
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\t"</span> + collection.getTitle() + <span class="code-quote">"\t:\t"</span> + collection.getHref());
+    }
+    <span class="code-object">System</span>.out.print(<span class="code-quote">"\n"</span>);
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 2. Getting a Feed
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+RequestOptions opts = <span class="code-keyword">new</span> RequestOptions();
+opts.setContentType(<span class="code-quote">"application/atom+xml;type=feed"</span>);
+ClientResponse response = abderaClient.get(FEED_URL, opts);
+Feed feed = (Feed)response.getDocument().getRoot();
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 3. Posting an entry to a Feed <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+RequestOptions opts = <span class="code-keyword">new</span> RequestOptions();
+opts.setContentType(<span class="code-quote">"application/atom+xml;type=entry"</span>);
+ClientResponse response = abderaClient.post(FEED_URL, newEntry, opts);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 4. Putting a change to an Entry <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+RequestOptions opts = <span class="code-keyword">new</span> RequestOptions();
+opts.setContentType(<span class="code-quote">"application/atom+xml;type=entry"</span>);
+ClientResponse response = abderaClient.put(ENTRY_URL, changedEntry.getDocument(), opts);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 5. Getting an Entry <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+RequestOptions opts = <span class="code-keyword">new</span> RequestOptions();
+opts.setContentType(<span class="code-quote">"application/atom+xml;type=entry"</span>);
+ClientResponse response = abderaClient.get(ENTRY_URL, opts);
+Entry entry = (Entry)response.getDocument().getRoot();
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 6. Deleting an Entry <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+ClientResponse response = abderaClient.delete(ENTRY_URL);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Apache Wink - Click on link to Download - <a href="attachments/2852765/4751361.java">APP_Client_Wink.java</a><br clear="all" /> </th>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 1. Acessing Service Document: <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Resource resource = restClient.resource(SERVICE_URL);
+AppService service = resource.accept(MediaTypeUtils.ATOM_SERVICE_DOCUMENT).get(AppService.class);
+List&lt;AppWorkspace&gt; workspaces = service.getWorkspace();
+<span class="code-keyword">for</span> (AppWorkspace workspace : workspaces) {
+    <span class="code-object">System</span>.out.println(<span class="code-quote">"\t"</span> + workspace.getTitle().getValue());
+    List&lt;AppCollection&gt; collections = workspace.getCollection();
+    <span class="code-keyword">for</span> (AppCollection collection : collections) {
+        <span class="code-object">System</span>.out.println(<span class="code-quote">"\t"</span> + collection.getTitle().getValue()
+            + <span class="code-quote">"\t:\t"</span>
+            + collection.getHref());
+    }
+    <span class="code-object">System</span>.out.print(<span class="code-quote">"\n"</span>);
+}
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 2. Getting a Feed <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Resource feedResource = restClient.resource(FEED_URL);
+AtomFeed feed = feedResource.accept(MediaType.APPLICATION_ATOM_XML).get(AtomFeed.class);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 3. Posting an entry to a Feed <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Resource feedResource = restClient.resource(FEED_URL);
+ClientResponse response =
+    feedResource.contentType(MediaType.APPLICATION_ATOM_XML).post(newEntry);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 4. Putting a change to an Entry <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Resource feedResource = restClient.resource(ENTRY_URL);
+ClientResponse response =
+    feedResource.contentType(MediaType.APPLICATION_ATOM_XML).put(changedEntry);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 5. Getting an Entry <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Resource feedResource = restClient.resource(ENTRY_URL);
+AtomEntry atomEntry = feedResource.accept(MediaType.APPLICATION_ATOM_XML).get(AtomEntry.class);
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+<tr>
+<td class='confluenceTd'> &nbsp;&nbsp;&nbsp; 6. Deleting an Entry <br clear="all" />
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+Resource feedResource = restClient.resource(ENTRY_URL);
+ClientResponse response = feedResource.delete();
+</pre>
+</div></div></td>
+</tr>
+<tr>
+</tr>
+</tbody></table>
+<hr />
+
+				    					    <br/>
+                        <div class="tabletitle">
+                            <a name="attachments">Attachments:</a>
+                        </div>
+
+                        <div class="greybox" align="left">
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113127.java">ConsumeAtomUsingWink.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113128.xml">ProduceAtomUsingAbdera_web.xml</a> (text/xml)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113129.java">ConsumeAtomUsingAbdera.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113130.java">ProduceAtomUsingAbdera.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113131">application</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113132.xml">ProduceAtomUsingWink_web.xml</a> (text/xml)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113133.xml">ProduceAtomWinkElegant_web.xml</a> (text/xml)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113134.java">ProduceAtomUsingWink.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113135.java">ProduceAtom.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113136.java">ConsumeRssUsingAbdera.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113137.zip">ProduceRss_Wink_Elegant.zip</a> (application/zip)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113138.zip">ProduceAtom_Wink_Elegant.zip</a> (application/zip)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/3113139.java">ConsumeRssUsingWink.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456452.zip">APP_Server_Wink.zip</a> (application/x-zip-compressed)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456454.zip">APP_Server_Abdera.zip</a> (application/x-zip-compressed)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456455.java">APP_ContentProvider.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456456.xml">APP_Server_Abdera_web.xml</a> (text/xml)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456457.java">APP_CollectionAdapter.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456458.jsp">APP_Server_Abdera_index.jsp</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456459.jsp">APP_Server_Wink_index.jsp</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456460.java">EntriesCollection.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456461">APP_Server_Wink_application</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4456462.xml">APP_Server_Wink_web.xml</a> (text/xml)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4751361.java">APP_Client_Wink.java</a> (application/octet-stream)
+                                <br/>
+                                                            <img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
+                                <a href="attachments/2852765/4751362.java">APP_Client_Abdera.java</a> (application/octet-stream)
+                                <br/>
+                                                    </div>
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:57</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix B - Google App Engine.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix%20B%20-%20Google%20App%20Engine.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix B - Google App Engine.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix B - Google App Engine.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : Appendix B - Google App Engine</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : Appendix B - Google App Engine
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Oct 14, 2009 by <font color="#0050B2">michael</font>.
+				    </div>
+
+				    <h2><a name="AppendixB-GoogleAppEngine-GoogleAppEngine"></a>Google App Engine</h2>
+
+<p>Apache Wink can be run using <a href="https://appengine.google.com/">Google App Engine</a> as the core functionality is fully compatible. However, due to some of the App Engine limitations, a number of the additional functions may not work correctly.</p>
+
+<h3><a name="AppendixB-GoogleAppEngine-KnownLimitations"></a>Known Limitations</h3>
+
+<p><b>JAXB</b> &#45; Google App Engine doesn't support JAXB. Therefore, the built-in JAXB, Atom and JSON providers will not work.</p>
+
+<h3><a name="AppendixB-GoogleAppEngine-Logging"></a>Logging</h3>
+
+<p>Google uses java.util.logging, also referred to as the JDK 1.4 logging. Apache Wink uses <a href="http://slf4j.org">slf4j</a>. In order to enable Wink's logging function, replace the <tt>slf4j-simple-&lt;version&gt;.jar</tt> with the <tt>slf4j-jdk14-&lt;version&gt;.jar</tt>.</p>
+
+<p>In order to view all of Wink's messages place the following property in the logging.properties file:</p>
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>org.apache.wink.level=ALL</pre>
+</div></div>
+
+
+<p>Everything that the servlet writes to the standard output stream (System.out) and standard error stream (System.err) is captured by the App Engine and then recorded in the application logs. </p>
+
+<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Useful Tip</b><br />In order to gain an in depth understanding refer to <a href="http://code.google.com/appengine/docs/java/runtime.html#Logging">Logging</a>.</td></tr></table></div> 
+
+
+
+<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>When running with <a href="http://www.springsource.org/">Spring</a>, make sure that you have <tt>jcl-over-slf4j-&lt;version&gt;.jar</tt> in the classpath. This jar is needed, since Spring uses commons-logging.</td></tr></table></div>
+
+<h3><a name="AppendixB-GoogleAppEngine-AdditionalIssues"></a>Additional Issues</h3>
+
+<p>The following section contains "<b>additional Issues</b>" that maybe experience while trying to run custom developer code in the Google App Engine. It is advantageous to read the relevant documentation as it provides important information, that will save valuable developer time that is required to ascertain why the application behaves differently in comparison to a regular servlet container.</p>
+
+<h4><a name="AppendixB-GoogleAppEngine-ContextPath"></a>Context Path</h4>
+
+<p>Usually the URI in a servlet container looks like this:
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>requestURI = contextPath + servletPath + pathInfo</pre>
+</div></div>while in most servlet containers context path is a war name (or it can be configured), in App Engine it's just empty.<br/>
+So if your servlet is mapped to "rest", access <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>http://host:port/rest</pre>
+</div></div>.</p>
+
+<h3><a name="AppendixB-GoogleAppEngine-References"></a>References</h3>
+
+<ul>
+	<li><a href="http://code.google.com/appengine/docs/java/overview.html">App Engine Java Overview</a></li>
+	<li><a href="http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine">Will it play in App Engine</a></li>
+</ul>
+
+
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:58</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Propchange: incubator/wink/site/trunk/src/site/resources/1.0/html/Appendix B - Google App Engine.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Application Configuration.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS%20Application%20Configuration.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Application Configuration.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Application Configuration.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : JAX-RS Application Configuration</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : JAX-RS Application Configuration
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Sep 10, 2009 by <font color="#0050B2">michael</font>.
+				    </div>
+
+				    <h2><a name="JAX-RSApplicationConfiguration-Applications"></a>Applications</h2>
+
+<p>A JAX-RS application consists of one or more resources and zero or more providers. A JAX-RS application is packaged as a Web application in a .war file. The Application subclass, resource classes, and providers are packaged in WEB-INF/classes file and the required libraries are packaged in WEB-INF/lib. Included libraries can also contain resource classes and providers as desired.<br/>
+When using a Servlet 3 container, the Application subclass is optional. By default, all root resource classes and providers packaged in the web application must be included in the published JAX-RS application.</p>
+
+<h3><a name="JAX-RSApplicationConfiguration-IncludingSubclasses"></a>Including Subclasses</h3>
+
+<p>An Application subclass can be included in a .war file to override the default behavior. If both getClasses and getSingletons return an empty list then the default "willset" of classes must be used. The implementations should support the Servlet 3 framework pluggability mechanism to enable portability between containers and to avail themselves of container-supplied class scanning facilities.</p>
+
+
+<h3><a name="JAX-RSApplicationConfiguration-ServletContainers"></a>Servlet Containers</h3>
+
+<p>When using a non-JAX-RS aware servlet container, the servlet-class or filter-class element of the web.xml descriptor should name the JAX-RS implementation-supplied Servlet or Filter class respectively. The application-supplied subclass of the application is identified, using an init-param with a param-name of the "javax.ws.rs.application".</p>
+
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:57</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Propchange: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Application Configuration.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Caching.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS%20Caching.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Caching.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Caching.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : JAX-RS Caching</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : JAX-RS Caching
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Oct 11, 2009 by <font color="#0050B2">michael</font>.
+				    </div>
+
+				    <h1><a name="JAX-RSCaching-JAXRSCaching"></a>JAX-RS Caching</h1>
+
+<p>TBD</p>
+
+<h2><a name="JAX-RSCaching-Expires"></a>Expires</h2>
+
+<p>TBD</p>
+
+<h2><a name="JAX-RSCaching-CacheControl"></a>Cache Control</h2>
+
+<p>TBD</p>
+
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:57</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Propchange: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Caching.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Content Negotiation.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS%20Content%20Negotiation.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Content Negotiation.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Content Negotiation.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,206 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : JAX-RS Content Negotiation</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : JAX-RS Content Negotiation
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Sep 22, 2009 by <font color="#0050B2">michael</font>.
+				    </div>
+
+				    <h1><a name="JAX-RSContentNegotiation-WhatisContentNegotiation%3F"></a>What is Content Negotiation?</h1>
+
+<p>One of the more popular features of REST applications is the ability to return different representations of resources.  For instance, data can be in <a href="http://json.org">JSON</a> format or in <a href="http://www.w3.org/XML/">XML</a>.  Or it can even be available in either format depending on the request.  Content negotiation is the way for clients and servers to agree on what content format is sent.</p>
+
+<p>Data is returned in multiple formats because the needs of each client's request can be different.  A browser might prefer JSON format.  Another command line based client might prefer XML format.  A third client might request the same resource as a PNG image.</p>
+
+<p>It is up to the service to determine which formats are supported.</p>
+
+<p>There are many practical ways of performing content negotiation.</p>
+
+<p><a name="JAX-RSContentNegotiation-URL"></a></p>
+
+<h3><a name="JAX-RSContentNegotiation-ContentNegotiationBasedonURL"></a>Content Negotiation Based on URL</h3>
+
+<p>Many popular public REST APIs perform content negotiation based on the URL.  For instance, a resource in XML format might be at <a href="http://example.com/resource.xml">http://example.com/resource.xml</a>.  The same resource could be offered in JSON format but located at <a href="http://example.com/resource.json">http://example.com/resource.json</a>.</p>
+
+<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>ContentNegotiationViaURL.java</b></div><div class="codeContent panelContent">
+<pre class="code-java">@Path(<span class="code-quote">"/resources"</span>)
+<span class="code-keyword">public</span> class Resource {
+
+    @Path(<span class="code-quote">"{resourceID}.xml"</span>)
+    @GET
+    <span class="code-keyword">public</span> Response getResourceInXML(@PathParam(<span class="code-quote">"resourceID"</span>) <span class="code-object">String</span> resourceID) {
+        <span class="code-keyword">return</span> Response.ok(/* entity in XML format */).type(MediaType.APPLICATION_XML).build();
+    }
+
+    @Path(<span class="code-quote">"{resourceID}.json"</span>)
+    @GET
+    <span class="code-keyword">public</span> Response getResourceInJSON(@PathParam(<span class="code-quote">"resourceID"</span>) <span class="code-object">String</span> resourceID) {
+        <span class="code-keyword">return</span> Response.ok(/* entity in JSON format */).type(MediaType.APPLICATION_JSON).build();
+    }
+}
+</pre>
+</div></div>
+<p>In the above code, a request to <b>"/resources/resourceID.myformat"</b> would result in a 404 status code.</p>
+
+<p>Another way of implementing the above is to use a single resource method like below:</p>
+
+<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>ContentNegotiationViaSingleMethod.java</b></div><div class="codeContent panelContent">
+<pre class="code-java">@Path(<span class="code-quote">"/resources"</span>)
+<span class="code-keyword">public</span> class Resource {
+
+    @Path(<span class="code-quote">"{resourceID}.{type}"</span>)
+    @GET
+    <span class="code-keyword">public</span> Response getResource(@PathParam(<span class="code-quote">"resourceID"</span>) <span class="code-object">String</span> resourceID, @PathParam(<span class="code-quote">"type"</span>) <span class="code-object">String</span> type) {
+        <span class="code-keyword">if</span> (<span class="code-quote">"xml"</span>.equals(type)) {
+            <span class="code-keyword">return</span> Response.ok(/* entity in XML format */).type(MediaType.APPLICATION_XML).build();
+        } <span class="code-keyword">else</span> <span class="code-keyword">if</span> (<span class="code-quote">"json"</span>.equals(type)) {
+            <span class="code-keyword">return</span> Response.ok("/* entity in JSON format */).type(MediaType.APPLICATION_JSON).build();
+        }
+
+        <span class="code-keyword">return</span> Response.status(404).build();
+    }
+
+}
+</pre>
+</div></div>
+<p>The previous code excerpt essentially behaves the same as the ContentNegotiationViaURL.java example.</p>
+
+<p><a name="JAX-RSContentNegotiation-Parameter"></a></p>
+
+<h3><a name="JAX-RSContentNegotiation-ContentNegotiationBasedonRequestParameter"></a>Content Negotiation Based on Request Parameter</h3>
+
+<p>Another popular method is for the client to specify the format in a parameter.  For instance, by default, a resource could be offered in XML at <a href="http://example.com/resource">http://example.com/resource</a>.  The JSON version could be retrieved by using a query parameter like <a href="http://example.com/resource?format=json">http://example.com/resource?format=json</a>.</p>
+
+<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>ContentNegotiationViaParameter.java</b></div><div class="codeContent panelContent">
+<pre class="code-java">@Path(<span class="code-quote">"/resources"</span>)
+<span class="code-keyword">public</span> class Resource {
+
+    @Path(<span class="code-quote">"{resourceID}"</span>)
+    @GET
+    <span class="code-keyword">public</span> Response getResource(@PathParam(<span class="code-quote">"resourceID"</span>) <span class="code-object">String</span> resourceID,
+                                 @QueryParam(<span class="code-quote">"format"</span>) <span class="code-object">String</span> format) {
+        <span class="code-keyword">if</span> (format == <span class="code-keyword">null</span> || <span class="code-quote">"xml"</span>.equals(format)) {
+            <span class="code-keyword">return</span> Response.ok(/* entity in XML format */).type(MediaType.APPLICATION_XML).build();
+        } <span class="code-keyword">else</span> <span class="code-keyword">if</span> (<span class="code-quote">"json"</span>.equals(format)) {
+            <span class="code-keyword">return</span> Response.ok(/* entity in JSON format */).type(MediaType.APPLICATION_JSON).build();
+        }
+
+        <span class="code-keyword">return</span> Response.notAcceptable(Variant.mediaTypes(MediaType.APPLICATION_XML_TYPE,
+                                                         MediaType.APPLICATION_JSON_TYPE).add()
+            .build()).build();
+    }
+}
+</pre>
+</div></div>
+<p><a name="JAX-RSContentNegotiation-AcceptHeader"></a></p>
+
+<h3><a name="JAX-RSContentNegotiation-ContentNegotiationBasedonAcceptHeader"></a>Content Negotiation Based on Accept Header</h3>
+
+<p>Perhaps the most powerful form of content negotiation, the HTTP <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">Accept header</a> is another way of specifying the preferred representation format.</p>
+
+<p>The following excerpt shows sample client code using the Wink RestClient:</p>
+
+<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>RestClientWithAcceptHeader.java</b></div><div class="codeContent panelContent">
+<pre class="code-java">    RestClient client = <span class="code-keyword">new</span> RestClient();
+    ClientResponse response = client.resource(<span class="code-quote">"http:<span class="code-comment">//example.com/resources/resource1"</span>).header(<span class="code-quote">"Accept"</span>, <span class="code-quote">"application/json;q=1.0, application/xml;q=0.8"</span>).get();
+</span>    <span class="code-comment">// find what format was sent back
+</span>    <span class="code-object">String</span> contentType = response.getHeaders().getFirst(<span class="code-quote">"Content-Type"</span>);
+
+    <span class="code-keyword">if</span> (contentType.contains(<span class="code-quote">"application/json"</span>)) {
+        JSONObject entity = response.getEntity(JSONObject.class); /* or use a <span class="code-object">String</span>, InputStream, or other provider that supports the entity media type */
+    } <span class="code-keyword">else</span> <span class="code-keyword">if</span> (contentType.contains(<span class="code-quote">"application/xml"</span>) {
+        <span class="code-object">String</span> entity = response.getEntity(<span class="code-object">String</span>.class); /* or use a JAXB class, InputStream, etc. */
+    }
+</pre>
+</div></div>
+<p>The following example implements sample client code using the <a href="http://hc.apache.org/httpclient-3.x/">Apache HttpClient</a>.</p>
+
+<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>HttpClientWithAcceptHeader.java</b></div><div class="codeContent panelContent">
+<pre class="code-java">    HttpClient client = <span class="code-keyword">new</span> HttpClient();
+    GetMethod getMethod =
+        <span class="code-keyword">new</span> GetMethod(<span class="code-quote">"http:<span class="code-comment">//example.com/resources/resource1"</span>);
+</span>    <span class="code-comment">// prefer JSON over XML but both are acceptable to the client
+</span>    getMethod.setRequestHeader(<span class="code-quote">"Accept"</span>, <span class="code-quote">"application/json;q=1.0, application/xml;q=0.8"</span>);
+    <span class="code-keyword">try</span> {
+        client.executeMethod(getMethod);
+
+        <span class="code-comment">// find what format was sent back
+</span>        getMethod.getResponseHeader(<span class="code-quote">"Content-Type"</span>).getValue();
+
+        <span class="code-comment">// use getMethod.getResponseBodyAsString() or getMethod.getResponseBodyAsStream()
+</span>        <span class="code-comment">// to read the body
+</span>    } <span class="code-keyword">finally</span> {
+        getMethod.releaseConnection();
+    }
+</pre>
+</div></div>
+<p>Using the @Context HttpHeaders injected variable, the client preferred response representation is found.</p>
+
+<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>ContentNegotiationViaAcceptHeaderAndHTTPHeaders.java</b></div><div class="codeContent panelContent">
+<pre class="code-java">@Path(<span class="code-quote">"/resources"</span>)
+<span class="code-keyword">public</span> class Resource {
+
+    @Context
+    <span class="code-keyword">private</span> HttpHeaders headers;
+
+    @Path(<span class="code-quote">"{resourceID}"</span>)
+    @GET
+    <span class="code-keyword">public</span> Response getResource(@PathParam(<span class="code-quote">"resourceID"</span>) <span class="code-object">String</span> resourceID) {
+        List&lt;MediaType&gt; acceptHeaders = headers.getAcceptableMediaTypes();
+        <span class="code-keyword">if</span> (acceptHeaders == <span class="code-keyword">null</span> || acceptHeaders.size() == 0) {
+            <span class="code-keyword">return</span> Response.ok(/* entity in XML format */).type(MediaType.APPLICATION_XML).build();
+        }
+
+        <span class="code-keyword">for</span> (MediaType mt : acceptHeaders) {
+            <span class="code-object">String</span> qValue = mt.getParameters().get(<span class="code-quote">"q"</span>);
+            <span class="code-keyword">if</span>(qValue != <span class="code-keyword">null</span> &amp;&amp; <span class="code-object">Double</span>.valueOf(qValue).doubleValue() == 0.0) {
+                <span class="code-keyword">break</span>;
+            }
+            <span class="code-keyword">if</span>(MediaType.APPLICATION_XML_TYPE.isCompatible(mt)) {
+                <span class="code-keyword">return</span> Response.ok(/* entity in XML format */).type(MediaType.APPLICATION_XML).build();
+            } <span class="code-keyword">else</span> <span class="code-keyword">if</span> (MediaType.APPLICATION_JSON_TYPE.isCompatible(mt)) {
+                <span class="code-keyword">return</span> Response.ok(/* entity in JSON format */).type(MediaType.APPLICATION_JSON).build();
+            }
+        }
+        <span class="code-keyword">return</span> Response.notAcceptable(Variant.mediaTypes(MediaType.APPLICATION_JSON_TYPE,
+                                                         MediaType.APPLICATION_XML_TYPE).add()
+            .build()).build();
+    }
+
+}
+</pre>
+</div></div>
+<p>If the client request does not have an Accept HTTP header, then by default the XML format is returned.  The @Context HttpHeaders.getAcceptableMediaTypes() method returns an ordered list, sorted by the client preference of the representations.</p>
+
+<p>Looping through the acceptable media types, if the preferred media type is compatible with one of the service's available return types, then the preferred media type is used.</p>
+
+<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Note</b><br />Note that the quality factor is checked.  In fairly rare requests, clients can let the service know that a media type should not be sent back (if the quality factor is 0.0).</td></tr></table></div> 
+
+
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:57</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Context Information.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS%20Context%20Information.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Context Information.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Context Information.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : JAX-RS Context Information</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : JAX-RS Context Information
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Aug 24, 2009 by <font color="#0050B2">bluk</font>.
+				    </div>
+
+				    <h1><a name="JAX-RSContextInformation-ContextInformation"></a>Context Information</h1>
+
+<p>In addition to request parameters and entities, there is more request information that can be accessed via request @Context injected variables.</p>
+
+<p>When a resource method is invoked, the runtime injects the @Context variables.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+@Path(<span class="code-quote">"/resource"</span>)
+<span class="code-keyword">public</span> class Resource {
+    @Context
+    <span class="code-keyword">private</span> HttpHeaders headers;
+
+    @GET
+    <span class="code-keyword">public</span> void get(@Context UriInfo uriInfo) {
+       /* use headers or uriInfo variable here */
+    }
+}
+</pre>
+</div></div>
+
+<p><a name="JAX-RSContextInformation-HttpHeaders"></a></p>
+<h3><a name="JAX-RSContextInformation-javax.ws.rs.core.HttpHeaders"></a>javax.ws.rs.core.HttpHeaders</h3>
+
+<p>HttpHeaders provides methods that allow users to access request headers.  A few convenience methods such as #getAcceptableLanguages() and #getAcceptableMediaTypes() provide client preference sorted acceptable responses.</p>
+
+<p><a name="JAX-RSContextInformation-UriInfo"></a></p>
+<h3><a name="JAX-RSContextInformation-javax.ws.rs.core.UriInfo"></a>javax.ws.rs.core.UriInfo</h3>
+
+<p>UriInfo provides methods so developers can find or build URI information of the current request.</p>
+
+<p><a name="JAX-RSContextInformation-SecurityContext"></a></p>
+<h3><a name="JAX-RSContextInformation-javax.ws.rs.core.SecurityContext"></a>javax.ws.rs.core.SecurityContext</h3>
+
+<p>SecurityContext provides access to the security information.</p>
+
+<p><a name="JAX-RSContextInformation-Request"></a></p>
+<h3><a name="JAX-RSContextInformation-javax.ws.rs.core.Request"></a>javax.ws.rs.core.Request</h3>
+
+<p>Request provides methods for evaluating preconditions and for selecting the best response variant based on the request headers.</p>
+
+<p><a name="JAX-RSContextInformation-Providers"></a></p>
+<h3><a name="JAX-RSContextInformation-javax.ws.rs.core.Providers"></a>javax.ws.rs.core.Providers</h3>
+
+<p>Providers allows access to the user and runtime provided MessageBodyReaders, MessageBodyWriters, ContextResolvers, and ExceptionMappers.  It is useful for other providers but can sometimes be useful for resource methods and classes.</p>
+
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:57</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file

Added: incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Getting Started.html
URL: http://svn.apache.org/viewvc/incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS%20Getting%20Started.html?rev=834791&view=auto
==============================================================================
--- incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Getting Started.html (added)
+++ incubator/wink/site/trunk/src/site/resources/1.0/html/JAX-RS Getting Started.html Wed Nov 11 07:39:44 2009
@@ -0,0 +1,180 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <title>Apache Wink : JAX-RS Getting Started</title>
+	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
+    </head>
+
+    <body>
+	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
+		    <tr>
+			    <td valign="top" class="pagebody">
+				    <div class="pageheader">
+					    <span class="pagetitle">
+                            Apache Wink : JAX-RS Getting Started
+                                                    </span>
+				    </div>
+				    <div class="pagesubheading">
+					    This page last changed on Oct 13, 2009 by <font color="#0050B2">bluk</font>.
+				    </div>
+
+				    <h1><a name="JAX-RSGettingStarted-CreatingaSimple%22HelloWorld%22Application"></a>Creating a Simple "Hello World" Application</h1>
+
+<p>The following example project will produce a simple JAX-RS application that can respond to requests at <b>"/helloworld"</b> with a <b>"Hello world&#33;"</b> plain text resource.  While not entirely RESTful, this example project is to show how to create a simple application and how to package it for consumption in a web container.</p>
+
+
+<p>The application is packaged in a WAR file (which is similar to a JAR/ZIP file, except with special files in certain locations and a defined layout).  It can be deployed in any web container, for example: Jetty, Tomcat and Geronimo. Perform the following steps in order to create the "<b>helloworld</b>" example application.</p>
+
+
+<h2><a name="JAX-RSGettingStarted-Step1CreatingtheRootResource"></a>Step 1 - Creating the Root Resource</h2>
+
+
+<h3><a name="JAX-RSGettingStarted-"></a></h3>
+
+<p>First, create a resource that will be used for HTTP GET requests to "<b>/helloworld</b>".</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">package</span> org.apache.wink.example.helloworld;
+
+<span class="code-keyword">import</span> javax.ws.rs.GET;
+<span class="code-keyword">import</span> javax.ws.rs.Path;
+
+@Path(<span class="code-quote">"/helloworld"</span>)
+<span class="code-keyword">public</span> class HelloWorldResource {
+
+    @GET
+    <span class="code-keyword">public</span> <span class="code-object">String</span> getMessage() {
+        <span class="code-keyword">return</span> <span class="code-quote">"Hello World!"</span>;
+    }
+}
+</pre>
+</div></div>
+
+<p>As shown above, the Java class is just a plain old Java object that has JAX-RS annotations.</p>
+
+<h2><a name="JAX-RSGettingStarted-Step2Creatingajavax.ws.rs.core.Applicationsubclass"></a>Step 2 - Creating a javax.ws.rs.core.Application sub-class</h2>
+
+
+
+<p>For non-JAX-RS aware web container environments (most environments are currently non JAX-RS aware), a j<b>avax.ws.rs.core.Application</b> sub-class needs to be created which returns sets of JAX-RS root resources and providers.  In the following example, there is only one root resource that will need to be returned.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">package</span> org.apache.wink.example.helloworld;
+
+<span class="code-keyword">import</span> java.util.HashSet;
+<span class="code-keyword">import</span> java.util.Set;
+
+<span class="code-keyword">import</span> javax.ws.rs.core.Application;
+
+<span class="code-keyword">public</span> class HelloWorldApplication <span class="code-keyword">extends</span> Application {
+
+    @Override
+    <span class="code-keyword">public</span> Set&lt;<span class="code-object">Class</span>&lt;?&gt;&gt; getClasses() {
+        Set&lt;<span class="code-object">Class</span>&lt;?&gt;&gt; classes = <span class="code-keyword">new</span> HashSet&lt;<span class="code-object">Class</span>&lt;?&gt;&gt;();
+        classes.add(HelloWorldResource.class);
+        <span class="code-keyword">return</span> classes;
+    }
+
+}
+</pre>
+</div></div>
+
+<h3><a name="JAX-RSGettingStarted-Compilingtheclasses"></a>Compiling the classes</h3>
+
+
+<p>Using the Apache Wink distribution's JARs in the classpath, compile the two classes from the previous example.</p>
+
+<h2><a name="JAX-RSGettingStarted-Step3Creatingaweb.xmlfile"></a>Step 3 - Creating a web.xml file</h2>
+
+
+
+
+<p>Now create a web.xml deployment descriptor.  The deployment descriptor details information about the web application in the WAR.  In this case, it says that the Apache Wink JAX-RS servlet should be initialized with a HelloWorldApplication instance.</p>
+
+<p>In addition, any requests that begin with /rest/ will be handled by the Apache Wink JAX-RS servlet.  So, the request URL would be "/rest/helloworld" to reach the HelloWorld resource.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;
+&lt;!DOCTYPE web-app PUBLIC
+ <span class="code-quote">"-<span class="code-comment">//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"</span>
+</span> <span class="code-quote">"http:<span class="code-comment">//java.sun.com/dtd/web-app_2_3.dtd"</span> &gt;
+</span>
+&lt;web-app&gt;
+    &lt;display-name&gt;Hello world Web Application&lt;/display-name&gt;
+    &lt;servlet&gt;
+        &lt;servlet-name&gt;HelloWorldApp&lt;/servlet-name&gt;
+        &lt;servlet-class&gt;org.apache.wink.server.internal.servlet.RestServlet&lt;/servlet-class&gt;
+        &lt;init-param&gt;
+            &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
+            &lt;param-value&gt;org.apache.wink.example.helloworld.HelloWorldApplication&lt;/param-value&gt;
+        &lt;/init-param&gt;
+        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
+    &lt;/servlet&gt;
+    &lt;servlet-mapping&gt;
+        &lt;servlet-name&gt;HelloWorldApp&lt;/servlet-name&gt;
+        &lt;url-pattern&gt;/<span class="code-keyword">rest</span>/*&lt;/url-pattern&gt;
+    &lt;/servlet-mapping&gt;
+&lt;/web-app&gt;
+</pre>
+</div></div>
+
+<h2><a name="JAX-RSGettingStarted-Step4PackagingthewebapplicationintoaWARfile"></a>Step 4 - Packaging the web application into a WAR file</h2>
+
+
+
+
+<p>Layout the application as follows and create a WAR file from the base directory (the one before WEB-INF). Create a WAR by running "jar cvf helloworld-jaxrs.war *" from the base directory.</p>
+
+<p>Not every JAR in the lib directory is necessary for all environments. Read the documentation for more information about the requirements.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+WEB-INF/classes/org/apache/wink/example/helloworld/HelloWorldApplication.class
+WEB-INF/classes/org/apache/wink/example/helloworld/HelloWorldResource.class
+WEB-INF/lib/activation-1.1.jar
+WEB-INF/lib/commons-lang-2.3.jar
+WEB-INF/lib/jaxb-api-2.1.jar
+WEB-INF/lib/jaxb-impl-2.1.4.jar
+WEB-INF/lib/json-20080701.jar
+WEB-INF/lib/jsr311-api-1.0.jar
+WEB-INF/lib/slf4j-api-1.5.8.jar
+WEB-INF/lib/slf4j-simple-1.5.8.jar
+WEB-INF/lib/stax-api-1.0-2.jar
+WEB-INF/lib/wink-common-&lt;version #&gt;.jar
+WEB-INF/lib/wink-server-&lt;version #&gt;.jar
+WEB-INF/web.xml
+</pre>
+</div></div>
+
+<h2><a name="JAX-RSGettingStarted-Step5InstallingtheWARfileintoyourenvironment"></a>Step 5 - Installing the WAR file into your environment</h2>
+
+
+
+
+<p>Most web container environments will take a WAR file and deploy it without any further configuration required.  However, note the "<b>Context Root</b>" of the web application, or change it as required.</p>
+
+<p>The context paths combine as follows:<br/>
+http://&lt;hostname&gt;/&lt;web application context root&gt;/&lt;servlet url mapping path&gt;/helloworld</p>
+
+<p>If the environment deployed the WAR file to a context root of "/helloworldapp", then the following URL would be required to reach the HelloWorldResource.</p>
+
+<p>http://&lt;hostname&gt;/helloworldapp/rest/helloworld</p>
+
+				    
+                    			    </td>
+		    </tr>
+	    </table>
+	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+			<tr>
+				<td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
+			</tr>
+		    <tr>
+			    <td align="center"><font color="grey">Document generated by Confluence on Nov 11, 2009 06:57</font></td>
+		    </tr>
+	    </table>
+    </body>
+</html>
\ No newline at end of file