Skip to main content

Posts

Showing posts with the label Java

JAX-RS Tutorilas: Hello World Example

Following is simple  JAX-RS  tutorial, which sends “Hello World” text as response string using JAX-RS API and Jersey implementation. Technologies and Tools used in this article: 1.    JDK  2.     Eclipse  3.    Tomcat 4.    Maven  5.     Jersey 1.8 Create Maven Web Project Create a Maven web project and name it "helloworld" . File -> New -> Other -> Maven Project -> Next Select  maven-archetype-webapp Select  Next Type  Group Id,   Artifact Id  and  Package  name And select  Finish Add Project Dependencies Add Jersey repository using Maven. Use following URL to get appropriate repository. http://mvnrepository.com/artifact/com.sun.jersey/jersey-server Now update pom.xml file. File : pom.xml <project ...  > ...         ... <dependencies>                 ...                 ... <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server&

JAX-RS Tutorials: REST API using Java

JAX-RS is API specification   for RESTful web services using Java. RESTful web services is implementation of REST ( Representational State Transfer ) which is architectural design for distributed system or in general we can say JAX-RS  is a set of APIs to develop REST service.   This is a brief introduction about REST and JAX-RS. You can find more information on REST on Wiki and JAX-RS Official Site. What is REST? Representational state transfer is an abstraction of the architecture of the World Wide Web. More precisely, REST is an architectural style consisting of a coordinated set of architectural constraints (source  Wikipedia ) As JAX-RS is only a specification, we need to use it's implemented library to create RESTful web service. Following are such list of libraries Apache CXF , an open source  Web service  framework. Jersey , the reference implementation from  Sun  (now  Oracle ). RESTeasy,  JBoss 's implementation. Restlet , created

MongoDb : CRUD Operations Using Java

This article will show you how to use Java to perform CRUD operations on MongoDB records. If you're new to MongoDB, we recommend starting with the Getting Started With MongoDB tutorial. To begin, we'll establish a Person and Person Images table (a collection in MongoDB) to make CRUD operations in MongoDB easier. Define Data Structure The following is the data structure of the Person  and  Person Images  table (collection in MongoDB). Person id Int (primary) username String first_name String last_name String email String description String birthdate Date country String state String city String lat String lang Strin

Subscribe for latest tutorial updates

* indicates required