-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
87 lines (57 loc) · 2.2 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Java REST example
=================
Description
-----------
Very basic example about how to develop a REST web application with Jersey [1]_,
Jetty [2]_, Maven [3]_ and Spring [4]_.
Jersey is the open source JAX-RS (JSR 311) [5]_ Reference Implementation for
building RESTful Web services.
With this example you could check how to develop REST web services in a web
application. Different methods in your application will be called depending on
the HTTP methods: GET, POST, PUT or DELETE.
This is based in a post by Tim Reardon in his blog:
http://blog.reardonsoftware.com/2009/03/jersey-jetty-and-maven-helloworld.html
This example has been developed using GNU/Linux and it is not tested in other
operative systems.
In order to launch the web application you should use the next command from the
main folder::
$ mvn jetty:run
Then you could go to the next URL with your browser to check if it works:
http://localhost:8080/java-rest-example/rest/helloworld
Moreover, you could use the examples at `scripts` folder to check if it works::
$ cd scripts/
$ get.sh
$ post.sh message.xml
$ put.sh 1 message.xml
$ delete.sh 1
Requirements
------------
* Java 1.6
* Maven 2
* cURL and Tidy (for scripts)
Execute the next command to install the required packages in Debian based
distributions::
# apt-get install openjdk-6-jdk
# apt-get install maven2
# apt-get install curl
# apt-get install tidy
Availability
------------
The cutting-edge version of this example is always available from the Git
repository at http://gitorious.org/java-rest-example/java-rest-example/.
Clone the repository with the next command::
$ git clone git://gitorious.org/java-rest-example/java-rest-example.git
License
-------
*Java REST example* is released under the terms of the GNU Affero General Public
License version 3 [6]_.
Please read the ``COPYING`` file for details.
Authors
-------
Please see ``AUTHORS`` file for more information about the authors.
.. [1] http://jersey.dev.java.net/
.. [2] http://jetty.codehaus.org/jetty/
.. [3] http://maven.apache.org/
.. [4] http://www.springsource.org/
.. [5] http://jcp.org/aboutJava/communityprocess/final/jsr311/index.html
.. [6] http://www.fsf.org/licensing/licenses/agpl.html