Questions tagged [path-parameter]
105 questions
0
votes
1 answer
How to do Url patterns in servlets web.xml
I have a question on if this is possible to do. I have a profile servlet that has 2 url patterns, /profile and /profile/* .So in my project I have a user use GET /profile to get all of the profiles in JSON. Each profile has a favorite team string.…

Bobby.lock
- 59
- 1
- 7
0
votes
1 answer
Java POST API call with Postman using @PathParam and List object
For my project requirement, I created an API in JAVA which accepts 2 parameters like below
getSimilarImages(@PathParam("rbcCode") String rbcCode, List fieldNames)
I am new to POSTMAN application.
Could anyone educate me on how do I call…

Aadi
- 55
- 9
0
votes
3 answers
How to use "?" no get Path Rest?
I am developing a rest server in java, netbeans.
I have my GET request:
//myip/application/v1/cardapio/id=1
@Stateless
@Path("v1/cardapio")
public class CardapioResource {
@GET
@Produces("application/json")
…

Júlio César Bindandi
- 117
- 9
0
votes
1 answer
How to use path parameters in http.put request
I want to know how to write the PUT request that sends parameters in the path. For example, dev changed the URL for the PUT request from a using a query string as parameters to using parameters in the path. When params were sent as query, I did…

Chris22
- 1,973
- 8
- 37
- 55
0
votes
1 answer
how to pass pathParam, queryParam and headers in one GET request when url is String variable
First question:
I have a API GET request which contains path parameters, query parameters and headers, and I'd like to put my request url as a string variable, how can I achieve it?
Second quesiton:
How to pass pathParams to a string variable?
I've…

Q.W.
- 122
- 1
- 10
0
votes
1 answer
Can PathParam be ever used without any parameter in Path annotation?
I am aware about the usage of PathParam annotation and the standard way to utilize it is :
@Path(/data/{id})
... getData(@PathParam("id") String id){...}
Can I use PathParam without a parameter in Path annotation? For eg:
@Path(/data)
...…

Raj Dosi
- 59
- 7
0
votes
1 answer
How to parse request parameter (query and path param) and request body in same POJO in REST API
I have a rest API (PUT verb) which accepts both request body and path params:
Ex:
curl --data {a:1, b:2} -X PUT "https://example.com/users/{username}/address/{addressname}"
I am trying to fetch both request body and path param in one POJO
Response…

pjain
- 663
- 10
- 21
0
votes
1 answer
org.springframework.beans.ConversionNotSupportedException:Failed to convert value of type 'java.lang.String' to required type 'java.util.Optional'
For the first time i am using Optional in Rest Web Service to make a Path Parameter as optional.
@RequestMapping(value = {"/hosts","/hosts/{name}"}, method = RequestMethod.GET, produces = "application/json")
public ResponseEntity

Niddhi Garg
- 55
- 8
0
votes
1 answer
@pathparam along with POST payload for apache-cxf webservice
My interface that is implemented by my impl class looks something like this
@POST
@Path("/callA/{A}")
public FObj invokeA(@PathParam("A") int a,FObj fobj);
And my customRouteBuilder is routing the request to the above exposed…

Rajeshwar
- 391
- 1
- 5
- 19
0
votes
0 answers
REST: pass a BigDecimal value in pathparam
how to pass a BigDecimal value in pathparam in browser URL?
@GET
@Path("helloxyz/{par1}/{par2}")
@Produces{MediaType.APPLICATION_JSON)
public helloxyz(@PathParam("par1") BigDecimal par1,@PathParam("par2") BigDecimal par2){
…

yeppe
- 679
- 1
- 11
- 43
0
votes
1 answer
jersey ContainerRequestFilter : getPathParameters gives empty values
I have an authorization filter. While trying to retrieve pathparameters, I am unable to get the values.
could someone please tell me, what is wrong with the below code.
@AuthorizedAccess //named exception
@Provider
public class…

Irshad
- 1,016
- 11
- 30
0
votes
3 answers
Will this be considered as bad RESTFul design?
I am working on designing the API's for the first time in Spring and I have the following use case:
Get all the products.
Get Products by ID.
Now, what I did was, I made a single API for this,
@Path("/products")
public interface ProductResource…

sarah
- 247
- 1
- 9
- 19
0
votes
0 answers
URL within Pathparam and Queryparam
I get a 404 error when trying to use this POST method:
@POST
@Path("/upload/new/{containerId}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response create(@PathParam("containerId") String…

Manu
- 1,065
- 14
- 21
0
votes
1 answer
PathParam Layer check REST
First of all have a nice weekend for those who are! For the other good luck :)
I am creating an app using rest architecture.
I just have a simple question but I don't know how to explain it.
So let's take an example and maybe the question will come…

Geoffrey
- 1,151
- 3
- 13
- 26
0
votes
1 answer
Links with path parameters in JSF
In social networks like facebook you have links like https://www..com//about for example.
How can this be done with JSF? I mean, the way I am doing now is with parameters (which is quite…

Aliuk
- 1,249
- 2
- 17
- 32