org.cruxframework.crux.core.shared.rest.annotation
Annotation Type PathParam


@Target(value={PARAMETER,METHOD})
@Retention(value=RUNTIME)
public @interface PathParam

Used to map a REST method parameter to a path parameter on the HTTP request

See the following example:

 ..
 @GET
 @Path("test/{param1}")
 public String testOperation(@PathParam("param1") String value) {
    return null;
 }
 

The parameter value will be bound to the fragment extracted from the requested path to the server.

Author:
Thiago da Rosa de Bustamante

Required Element Summary
 String value
          Defines the name of the URI template parameter whose value will be used to initialize the value of the annotated method parameter, class field or property.
 

Element Detail

value

public abstract String value
Defines the name of the URI template parameter whose value will be used to initialize the value of the annotated method parameter, class field or property. See Path.value() for a description of the syntax of template parameters.

E.g. a class annotated with: @Path("widgets/{id}") can have methods annotated whose arguments are annotated with @PathParam("id").



Copyright © 2014. All rights reserved.