Showing posts from July, 2014

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 -> NextSelect maven-archetype-webappSelect NextType Group Id,Artifact Id and Package nameAnd select FinishAdd Project Dependencies
Add Jersey repository using Maven. Use following URL to get appropriate repository. Now update pom.xml file. File : pom.xml
<project ... > ...         ...

Sass Tutorials

Sass(SyntacticallyAwesomeStylesheets)is scripting language which produces Cascading Style Sheets(CSS).
Sass is compatible with all CSS version and has assorted features. It is open source and developed in Ruby.
What does Sass do?In simple terms by using Sass and its features we can create robust and large Style sheet with less effort and in less time.
How to Install Sass?Sass requires Ruby, so if you are using Windows System then you need to install Ruby first. Here is URL of Ruby Installer.
Otherwise if you use Mac or Linux System then you don’t need Ruby, it is pre-configured.
Use following commands to install Sass
sudo gem install sass
use following command to verify  Sass is installed properly or not.

sass  -v
To begin with Sass, create Sass “main.scss” file and CSS “main.css” file
Then run following command
sass --watch main.scss:main.css
It will update main.css file whenever you do changes and save Sass file.
Sass Script
1. VariableSass variable is use to store information at one place and can…

JAX-RS Tutorials: REST API using Java

JAX-RS is API specificationfor 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 by Jerome Louvel, a pioneer in REST frameworksApache WinkApache …