Coding in REST JERSEY Basics

1. ) In the class declaration, the @PATH annotation is declared.
this path will be the corresponding to this class will process.

@PATH (“/login”)
public class Login(){

2. ) the methods will have the annotation if what is its type,
what it produces, or what it consumes. Also the sub path is included.

example method annotation types are:

example of @Produces are:
application/json, application/xml, text/plain, text/html

here a sample code:

@GET @Path(“/user”)
public Login getUser() { … }

See 3.3 Sub-resources section of this link below:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s