<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>indiWiz.com &#187; jax-rs</title>
	<atom:link href="http://indiwiz.com/tag/jax-rs/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiwiz.com</link>
	<description>Subhash&#039;s Tech Log</description>
	<lastBuildDate>Wed, 03 Mar 2010 13:24:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting started with JBoss RESTEasy 1.0</title>
		<link>http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/</link>
		<comments>http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 11:07:43 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jax-rs]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=176</guid>
		<description><![CDATA[So ready to jump start into JBoss RESTEasy? Dive! Writing the JAX-RS Class The first step, let us write a simple echo service using JAX-RS: package testpackage; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; @Path(&#34;/echo&#34;) public class Echo { @GET @Path(&#34;/{message}&#34;) public Response echoService(@PathParam(&#34;message&#34;) String message){ return Response.status(200).entity(message).build(); } } Adding the JBoss RESTEasy [...]]]></description>
			<content:encoded><![CDATA[<p>So ready to jump start into <a href="http://www.jboss.org/resteasy/">JBoss RESTEasy</a>? Dive!</p>
<h3>Writing the JAX-RS Class</h3>
<p>The first step, let us write a simple echo service using JAX-RS:</p>
<pre class="brush: java;">
package testpackage;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;

@Path(&quot;/echo&quot;)
public class Echo {
    @GET
    @Path(&quot;/{message}&quot;)
    public Response echoService(@PathParam(&quot;message&quot;) String message){
        return Response.status(200).entity(message).build();
    }
}
</pre>
<h3>Adding the JBoss RESTEasy dependency to Maven project</h3>
<p>If you are using Maven to build your projects, add the dependency for RESTEasy:</p>
<pre class="brush: xml;">
&lt;dependency&gt;
    &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
    &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
    &lt;version&gt;1.0.0.GA&lt;/version&gt;
&lt;/dependency&gt;
</pre>
<p>Also remember to add the JBoss repository to the <tt>pom.xml</tt> (RESTEasy is not available in Maven public repository):</p>
<pre class="brush: xml;">
&lt;repository&gt;
    &lt;id&gt;jboss&lt;/id&gt;
    &lt;url&gt;http://repository.jboss.com/maven2/&lt;/url&gt;
    &lt;releases&gt;
        &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;/releases&gt;
    &lt;snapshots&gt;
        &lt;enabled&gt;false&lt;/enabled&gt;
    &lt;/snapshots&gt;
&lt;/repository&gt;
</pre>
<h3>Configuring web.xml</h3>
<p>The bare minimum needed to have RESTEasy running is:</p>
<pre class="brush: xml;">
&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;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;
</pre>
<p>Above, we have just added the RESTEasy servlet and listener. Now we have to make it load our JAX-RS class. This can be done in two ways. One, just let RESTEasy scan the CLASSPATH to identify and load JAX-RS resources:</p>
<pre class="brush: xml;">
&lt;web-app ...&gt;
    ...
    &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;
    ...
&lt;/web-app&gt;
</pre>
<p>The other option is to specify the resources manually (use CSV format):</p>
<pre class="brush: xml;">
&lt;web-app ...&gt;
    ...
    &lt;context-param&gt;
        &lt;param-name&gt;resteasy.resources&lt;/param-name&gt;
        &lt;param-value&gt;testpackage.Echo&lt;/param-value&gt;
    &lt;/context-param&gt;
    ...
&lt;/web-app&gt;
</pre>
<p>After deploying this, you may access your application (if your are using default Tomcat/Jetty installation): <a href="http://localhost:8080/resteasytest/echo/hello,world">http://localhost:8080/resteasytest/echo/hello,world</a> (assumes your application is deployed as <tt>resteasytest.war</tt>)</p>


<div class="shr-bookmarks shr-bookmarks-expand">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/&amp;title=Getting+started+with+JBoss+RESTEasy+1.0" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/&amp;title=Getting+started+with+JBoss+RESTEasy+1.0" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/&amp;title=Getting+started+with+JBoss+RESTEasy+1.0&amp;desc=So%20ready%20to%20jump%20start%20into%20JBoss%20RESTEasy%3F%20Dive%21%0A%0AWriting%20the%20JAX-RS%20Class%0A%0AThe%20first%20step%2C%20let%20us%20write%20a%20simple%20echo%20service%20using%20JAX-RS%3A%0A%0A%5Bsourcecode%20language%3D%27java%27%5D%0Apackage%20testpackage%3B%0A%0Aimport%20javax.ws.rs.GET%3B%0Aimport%20javax.ws.rs.Path%3B%0Aimport%20javax.ws.rs.PathParam%3B%0Aimport%20javax.ws.rs.core.Res" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/&amp;t=Getting+started+with+JBoss+RESTEasy+1.0" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/&amp;title=Getting+started+with+JBoss+RESTEasy+1.0&amp;summary=So%20ready%20to%20jump%20start%20into%20JBoss%20RESTEasy%3F%20Dive%21%0A%0AWriting%20the%20JAX-RS%20Class%0A%0AThe%20first%20step%2C%20let%20us%20write%20a%20simple%20echo%20service%20using%20JAX-RS%3A%0A%0A%5Bsourcecode%20language%3D%27java%27%5D%0Apackage%20testpackage%3B%0A%0Aimport%20javax.ws.rs.GET%3B%0Aimport%20javax.ws.rs.Path%3B%0Aimport%20javax.ws.rs.PathParam%3B%0Aimport%20javax.ws.rs.core.Res&amp;source=indiWiz.com" rel="nofollow" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/&amp;title=Getting+started+with+JBoss+RESTEasy+1.0" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JBoss RESTEasy 1.0 Released</title>
		<link>http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/</link>
		<comments>http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 11:11:07 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[jax-rs]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=162</guid>
		<description><![CDATA[I have been awaiting the GA release of RESTEasy for some time! Now we have an alternative to Glasssfish Jersey JAX-RS engine. Share this on del.icio.us Digg this! Post this on Diigo Share this on Facebook Share this on LinkedIn Share this on Reddit]]></description>
			<content:encoded><![CDATA[<p>I have been awaiting the GA release of <a href="http://www.jboss.org/resteasy/">RESTEasy</a> for some time! Now we have an alternative to <a href="https://jersey.dev.java.net/">Glasssfish Jersey</a> <a href="http://jcp.org/en/jsr/detail?id=311">JAX-RS</a> engine.</p>


<div class="shr-bookmarks shr-bookmarks-expand">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/&amp;title=JBoss+RESTEasy+1.0+Released" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/&amp;title=JBoss+RESTEasy+1.0+Released" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/&amp;title=JBoss+RESTEasy+1.0+Released&amp;desc=I%20have%20been%20awaiting%20the%20GA%20release%20of%20RESTEasy%20for%20some%20time%21%20Now%20we%20have%20an%20alternative%20to%20Glasssfish%20Jersey%20JAX-RS%20engine." rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/&amp;t=JBoss+RESTEasy+1.0+Released" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/&amp;title=JBoss+RESTEasy+1.0+Released&amp;summary=I%20have%20been%20awaiting%20the%20GA%20release%20of%20RESTEasy%20for%20some%20time%21%20Now%20we%20have%20an%20alternative%20to%20Glasssfish%20Jersey%20JAX-RS%20engine.&amp;source=indiWiz.com" rel="nofollow" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/&amp;title=JBoss+RESTEasy+1.0+Released" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/01/23/jboss-resteasy-10-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
