Questions tagged [path-parameter]
79 questions
65
votes
5 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
- 713
- 2
- 6
- 7
58
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
- 783
- 1
- 7
- 19
37
votes
6 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
- 785
- 2
- 11
- 12
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
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
- 66,525
- 139
- 452
- 886
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
- 674
- 1
- 6
- 15
8
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
- 14,105
- 33
- 107
- 185
6
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
- 526
- 4
- 16
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
- 24,799
- 13
- 87
- 109
4
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
- 24,933
- 92
- 299
- 571
4
votes
0 answers
RESTEasy cannot take in @PathParam typed Long
I have seen in tutorial (Jersey) that there is possibility to pass in JAX-RS @PathParam of type Long.
But when I have tried to do this with RESTEasy I'm getting error:
21:50:32,353 WARN [org.jboss.resteasy.core.ExceptionHandler] (default…
Michał Ziobro
- 7,390
- 6
- 50
- 99
4
votes
4 answers
JAX-RS, path params don't work
I try to pass a parameter via GET to a REST method.
@GET
@Path("{id}")
public Response getUser(@PathParam("id") String id) {
Query qry = em.createQuery("from User c WHERE id = :user_id");
qry.setParameter("user_id", id);
List…
Journerist
- 500
- 3
- 16
4
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
- 2,727
- 3
- 27
- 32
4
votes
2 answers
Accept comma separated value in REST Webservice
I am trying to receive a list of String as comma separated value in the REST URI ( sample :
http://localhost:8080/com.vogella.jersey.first/rest/todo/test/1/abc,test
, where abc and test are the comma separated values passed in).
Currently I am…
coder
- 373
- 1
- 5
- 18
4
votes
1 answer
How to parse path-parameter with webapp2
I am coming from a Java REST background to Python on Google App Engine's. I need some help using webapp2 with path-parameters. Below is an example of how Java would read a request. Will someone please translate the code into how python would read it…
kasavbere
- 5,583
- 9
- 46
- 71