How to get path parameters and matrix parameters from the next uri line? Uri is / flights / flightid; numberofseats = 2 / date

I am trying to separate param and param parameter from next uri line parameter in knitwear.

/ flight / flightid; numberofseats = 2 / date.

I want to separate the following parameters with knitwear

  • Flightid
  • numberofseats
  • the date

I tried all this code to split, but I failed.

@GET
@Path(value = "/flight/{flightid}/{date}")
@Produces(MediaType.TEXT_PLAIN)
public Response bookFlight(@MatrixParam("numberofseats") int numberOfSeats,
        @PathParam(value = "flightid") int flightid,
        @PathParam(value = "date") String date) {
    //Logic
}
+4
source share
1 answer

, , URI. , Path, URI @PathParam . . 3.7.3 JAX-RS 2.0 Spec.

, .

flightid (, , ) .

0

All Articles