Skip to content

abdurrahmankolsuz/jersey-server-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTful Web Services

Basic useful feature list:

  • Included rest services implemented by Jersey 2 + Tomcat 8
  • Included rest services implemented by jersey grizzly2-http
  • Jersey + Google Gson
  • Data Transfer with bson4jackson

And here's some code! 👍

		ClientConfig clientConfig = new DefaultClientConfig();
	        clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
	        Client client = Client.create(clientConfig);

	        String getURL = "http://localhost:8080/allMissions";
	        WebResource webResourceGet = client.resource(getURL);
	        ClientResponse response = webResourceGet.accept("application/json").get(ClientResponse.class);
	    	String output = response.getEntity(String.class);
	        
		Type listType = new TypeToken<ResponseAllMissions>(){}.getType();
		ResponseAllMissions responseAllMissions =new Gson().fromJson(output, listType);

This is on GitHub so let me know if I've burked it somewhere.

Stuff used to make this:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages