Questions tagged [path-parameter]
105 questions
79
votes
7 answers
RestTemplate: How to send URL and query parameters together
I am trying to pass path param and query params in a URL but I am getting a weird error. Below is the code.
String url = "http://test.com/Services/rest/{id}/Identifier"
Map params = new HashMap();
…

Shiva
- 913
- 2
- 8
- 7
73
votes
7 answers
What is the difference between @PathParam and @PathVariable
To my knowledge both serves the same purpose. Except the fact that @PathVariable is from Spring MVC and @PathParam is from JAX-RS. Any insights on this?

suresh
- 943
- 2
- 8
- 22
40
votes
7 answers
Servlet and path parameters like /xyz/{value}/test, how to map in web.xml?
Does servlet support urls as follows:
/xyz/{value}/test
where value could be replaced by text or number.
How to map that in the web.xml?

BlackEagle
- 814
- 2
- 12
- 13
14
votes
4 answers
Angular router navigation changes url, but doesn't render component
I am working on an angular application with routing and path parameter. With a button click, a function is called to redirect the user to a new URL with the same path parameter. Although the URL in the browser changes, the corresponding component…

sivakumm
- 141
- 1
- 1
- 3
12
votes
3 answers
Any way to get the path parameters in httpservlet request
I have rest service implemented.
I am trying to get the path parameters of the the request in filter.
My request is
/api/test/{id1}/{status}
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
throws…

Patan
- 17,073
- 36
- 124
- 198
11
votes
1 answer
Using Query String in REST Web Services
I thought one main characteristic and reason for using REST web services was to use path parameters rather than query parameters. But many publicly available REST web services use query parameters.
Am I wrong in thinking that query parameters are…
user2295633
10
votes
2 answers
Rest URL Standards - Multiple Path Parameters
We are building a restful service for serving employee data.
We have an api which will return the list of employees who belong to a specific department of a client.
This api takes 2 parameters - clientId and departmentId
As per standards which of…

Kalyan Chakravarthy S
- 716
- 2
- 7
- 20
10
votes
2 answers
Wildcard path for servlet?
Having an @WebServlet(urlPatterns = "/myServlet/"). If the user goes to myapp/myServlet/other, I still want my servlet to catch. So to say, wildcard anything on after the servlet path. How could I do this?

membersound
- 81,582
- 193
- 585
- 1,120
8
votes
1 answer
Jersey: @PathParam with commas to List
I would like to call my Webservice with this pattern :
/resource/1,2,3
And in my Class I want to bind my parameters to a List of Object
@Path("/resource")
public class AppWS {
@GET
@Path("/{params}")
public Response…

Guillaume
- 694
- 1
- 6
- 15
5
votes
1 answer
Mounting a Vert.x sub-router on a path with path parameters
I want to create a URL structure for my Vert.x Web powered API that makes it clear how some entities are "contained" inside other entities and how you "traverse the entity path" to find child entities, so I'm thinking of using something like this to…

Guss
- 30,470
- 17
- 104
- 128
5
votes
1 answer
Making path parameters optional in WebSocket endpoints in Java EE
Given a WebSocket endpoint as follows.
@ServerEndpoint(value = "/Push/CartPush/{token}")
public final class CartPush {
// ...
}
The endpoint is able to accept a path parameter {token}. The path parameter is however, optional which is determined…

Tiny
- 27,221
- 105
- 339
- 599
5
votes
2 answers
Store @PathParam values from REST call in a list or array
My function looks like this:
@PUT
@Path("property/{uuid}/{key}/{value}")
@Produces("application/xml")
public Map updateProperty(@Context HttpServletRequest request,
@PathParam("key") String key,
…

gmode
- 3,601
- 4
- 31
- 39
4
votes
1 answer
How can i get Url Path parameters in servlet-filter?
Map pathVariables = (Map) request
.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
Using above code, I was able to get the pathVariables but...
How can i get these parameters in order,…

Gourav Kumar
- 205
- 1
- 7
4
votes
1 answer
gin - problem accessing url-encoded path-param containing forward slash
For a given route with path param (example below)
router.GET("/employee/:id", empHandler.GetEmployee)
When tried to invoke the url with id path-param(encoded) containing forward slashes
id = 21/admin/527
url-encoded id =…

Vivek
- 11,938
- 19
- 92
- 127
4
votes
2 answers
OpenAPI path/query parameters nested structure serialization
In the OpenAPI docs about parameter serialization there's a short section about how to serialize query, path, header and cookie parameters with different styles. The schema of these parameters are described as OpenAPI flavoured json schema, which…

Balázs Édes
- 13,452
- 6
- 54
- 89