Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to learn to build a simple java rest server [closed]

Tags:

Hello people of the world!

I'm an Android developer and so far I've worked only on the client side. My next project is in need of a server to communicate with and I wanna try to build it myself.

Can someone give me direction to a good source of learning how to build a nice, small and simple Java restful server?

I've looked around, there is way too much info out there and it's confusing. Maybe one of you was in my shoes already and know a good source for it?

like image 472
Yosi199 Avatar asked Jun 29 '13 14:06

Yosi199


Video Answer


1 Answers

First of all you should read up on and learn how to use Jersey. This is the best implementation of JAX-RS API (REST for Java).

You will also need a good HTTP server and Java Servlet container. For that I'd advise you to use Jetty. Here are a few good tutorials:

  1. Crunchify: Build RESTful Service in Java using JAX-RS and Jersey (Celsius to Fahrenheit & Fahrenheit to Celsius)
  2. Vogella: REST with Java (JAX-RS) using Jersey - Tutorial

You asked for a "simple server", however if you're looking for high performance then read this tutorial: Javarants: Using JAX-RS with Protocol Buffers for high-performance REST APIs, and use the Grizzly container instead of Jetty:

like image 105
Oleksandr Karaberov Avatar answered Sep 24 '22 14:09

Oleksandr Karaberov