Skip to content

RestWithEclipseMaterials

martonivan edited this page May 27, 2011 · 2 revisions

Should be installed:

Tomcat: http://tomcat.apache.org/download-60.cgi

How to install Tomcat on OSX: http://developer.apple.com/internet/java/tomcat1.html With some modifications:

Download & Unpack: [[http://xenia.sote.hu/ftp/mirrors/www.apache.org/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip]]
$ sudo mv /Users/martoni/Downloads/apache-tomcat-6.0.32 /usr/local/
$ chmod ug+x /usr/local/apache-tomcat-6.0.32/bin/*.sh	
Create startup and stop scripts:
$ cd ~/bin
$ cat > start_tomcat
#!/bin/sh
export CATALINA_HOME=/usr/local/apache-tomcat-6.0.32
export JAVA_HOME=/usr
$CATALINA_HOME/bin/startup.sh
^D
$ cat > stop_tomcat
#!/bin/sh
export CATALINA_HOME=/usr/local/apache-tomcat-6.0.32
export JAVA_HOME=/usr
$CATALINA_HOME/bin/shutdown.sh
^D
chmod ug+x start_tomcat stop_tomcat

Jersey:

http://download.java.net/maven/2/com/sun/jersey/jersey-archive/1.7/jersey-archive-1.7.zip

http://jersey.java.net/nonav/documentation/latest/chapter_deps.html

Maven dependency:

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-client</artifactId>
    <version>1.7</version>
</dependency>

Additional JSON Maven dependency:

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-json</artifactId>
    <version>1.7</version>
</dependency>

A REST client - useful for testing: http://code.google.com/p/rest-client/

Let's see what is worth to read step-by-step!

About Java Web development: http://www.vogella.de/articles/JavaWebTerminology/article.html (Overview, concepts in Java terminology; about 5 minutes)

About Eclips EWT (Eclipse Web Tool Platform): http://www.vogella.de/articles/EclipseWTP/article.html (How to set up Eclipse as web and Java EE environment, Connect Eclipse to Tomcat and write and deploy an example Servlet; 45 minutes)

JAX-RS based REST development in Java: http://www.vogella.de/articles/REST/article.html (REST WS development, How to use Jersey, How to write an example REST service and client)

Tutorial

There is a really useful tutorial on youtube (it takes approx. 2 hours to watch them):

Source codes:

Clone this wiki locally