<?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>Sun, 29 Apr 2012 15:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</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: Adding the JBoss RESTEasy dependency to Maven project If you are using Maven to build your projects, add the dependency for RESTEasy: Also remember to add the JBoss repository to [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><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; title: ; notranslate">
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; title: ; notranslate">
&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; title: ; notranslate">
&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; title: ; notranslate">
&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; title: ; notranslate">
&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; title: ; notranslate">
&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-publisher-176"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/01/26/getting-started-with-jboss-resteasy-10/feed/</wfw:commentRss>
		<slash:comments>8</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.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><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-publisher-162"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></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>

