RESTful Web Services First Application with Eclipse & Tomcat

preview_player
Показать описание
JAX-RS: Java API for RESTful Web Services (JAX-RS) is a Java programming language API spec that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern. JAX-RS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints.

Specification

@Path specifies the relative path for a resource class or method.
@GET, @PUT, @POST, @DELETE and @HEAD specify the HTTP request type of a resource.
@Produces specifies the response Internet media types (used for content negotiation).
@Consumes specifies the accepted request Internet media types.
In addition, it provides further annotations to method parameters to pull information out of the request. All the @*Param annotations take a key of some form which is used to look up the value required.

@PathParam binds the method parameter to a path segment.
@QueryParam binds the method parameter to the value of an HTTP query parameter.
@MatrixParam binds the method parameter to the value of an HTTP matrix parameter.
@HeaderParam binds the method parameter to an HTTP header value.
@CookieParam binds the method parameter to a cookie value.
@FormParam binds the method parameter to a form value.
@DefaultValue specifies a default value for the above bindings when the key is not found.
@Context returns the entire context of the object (for example @Context HttpServletRequest request).
Рекомендации по теме
Комментарии
Автор

Thanks for thistutorial.
Do I have to use jdk 1.8 for this to work?

SvendErix
Автор

Thanks for tutorial. How do you do maven build? When i select Run as ->Maven Build, i need to provider some parameter in Goals. I am not sure what should I put there

rekhagaikwad
Автор

Hello, thanks for sharing this information. Everything worked as you have explained to. Great explanation! Thank you!

hernandorodriguez
Автор

Hi, I am not getting an output in xml format.
and index error.Could you please help me

mounikanaga
Автор

great vid.how can we connect jquery and ajax to this?

mishaneperera
Автор

Hi, thank you for the tutorial. but when i try to run project on the server. the server doesnt startand i get this error "Server Tomcat v8.5 Server at localhost failed to start." could you please help with that?

kaapoodikapa
Автор

I got this error at 4:53

Type: Status Report

Description: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

gunabalang