Questions tagged [http-request-parameters]

The parameters that are mapped to the servlet request when they are parsed from the http request.

The parameters that are mapped to the servlet request when they are parsed from the http request. These parameters represent a query string when a method GET is used and a body of the request if a method POST is used.

276 questions
103
votes
6 answers

What is difference between @RequestBody and @RequestParam?

I have gone through the Spring documentation to know about @RequestBody, and they have given the following explanation: The @RequestBody method parameter annotation indicates that a method parameter should be bound to the value of the HTTP request…
71
votes
4 answers

Spring MVC - Why not able to use @RequestBody and @RequestParam together

Using HTTP dev client with Post request and Content-Type application/x-www-form-urlencoded 1) Only @RequestBody URL: localhost:8080/SpringMVC/welcome Body: name=abc @RequestMapping(method = RequestMethod.POST) public String printWelcome(@RequestBody…
abhihello123
  • 1,668
  • 1
  • 22
  • 38
50
votes
5 answers

Spring @RequestParam mapping Boolean based on 1 or 0 instead of true or false

Why is Spring 3.2 only mapping my Boolean based on that the requestparam is "0" or "1" ? @RequestParam(required= false, defaultValue = "false") Boolean preview Preview will only be "true" when the requestparam is "?preview=1" which is wierd I want…
Tommy
  • 4,011
  • 9
  • 37
  • 59
38
votes
4 answers

How do I process GET query string URL parameters in backing bean on page load?

I've read how to send parameters using JSF but what if the user types their companyId in the URL when accessing their login page? For example, http://my.company.url/productName/login.faces?companyId=acme. The way we do it now, there is a bit of…
Big Al
  • 481
  • 1
  • 7
  • 14
23
votes
2 answers

Retaining GET request query string parameters on JSF form submit

I have 3 pages: main.xhtml agreement.xhtml generated.xhtml The agreement.xhtml needs two parameters to load correctly: serviceId and site. So, a normal url looks like this: /app/agreement.xhtml?site=US&serviceId=AABBCC. I have this button on…
Nacho321
  • 1,911
  • 7
  • 33
  • 55
20
votes
3 answers

Spring Boot : Custom Validation in Request Params

I want to validate one of the request parameters in my controller . The request parameter should be from one of the list of given values , if not , an error should be thrown . In the below code , I want the request param orderBy to be from the list…
18
votes
6 answers

Encode/obfuscate HTTP parameters

We are currently working on a very simple Webapp, and we would like to "obfuscate" ( what would be the right term? ) or encode somehow the request parameter, so we can reduce the chance an idle user from sending arbitrarily data. For instance, the…
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
16
votes
3 answers

Swift: HTTP request with parameters in header

i need to send an HTTP request, I can do that but my API in Backendless requires application-id and secret-key in HTTP Request Header. Can you help how to add it into my code? Thanks let urlString = "https://api.backendless.com/v1/data/Pub" let…
15
votes
1 answer

HTTPServletRequest getParameterMap() vs getParameterNames

HTTPServletRequest req, has a method getParameterMap() but, the values return a String[] instead of String, for post data as name=Marry&lastName=John&Age=20. I see in the post data it's not an array, but getParameterMap() returns array for every…
NNikN
  • 3,720
  • 6
  • 44
  • 86
13
votes
2 answers

Spring MVC : Common param in all requests

I have many controllers in my Spring MVC web application and there is a param mandatoryParam let's say which has to be present in all the requests to the web application. Now I want to make that param-value available to all the methods in my…
Amit
  • 33,847
  • 91
  • 226
  • 299
10
votes
5 answers

Required String parameter is not present Spring MVC

I want to access two different pages in my browser using: http://localhost:8080/name?views and http://localhost:8080/name?uviews But I'm getting error Required String parameter 'uviews' is not present when I use first url and I get Required String…
LeTadas
  • 3,436
  • 9
  • 33
  • 65
10
votes
2 answers

In Spring, how do I bind a list of integers to a RequestParam?

I have parameters from the client that are being sent such as ids[] = 11 ids[] = 12 ids[] = 21 On the server side, I have a Spring controller with the following method: @RequestMapping("/delete.x") public @ResponseBody Map
James
  • 2,876
  • 18
  • 72
  • 116
9
votes
1 answer

Spring @RequestParam Date Formatting

How do you format the incoming @RequestParam using annotations? The form is sending the date in MM/DD/YYYY format and the controller is not picking it up as a valid Date. @RequestMapping(params="/updateDate") public @ResponseBody String…
user4778174
8
votes
3 answers

What's the best way to encode and decode parameter in springboot?

I use @RequestParam to get the parameter value,but I find the if I pass the value like 'name=abc&def&id=123',I will get the name value 'abc' instead of 'abc&def'. I find the encode and decode the parameter value can solve my problem.But I have to…
Rebecca
  • 199
  • 2
  • 8
8
votes
2 answers

Customize Spring @RequestParam Deserialization for Maps and/or Nested Objects

@RestController class MyController { @RequestMapping(...) public void test(Container container) { ... } } Spring by default uses Dot-Notation to deserialize a nested @RequestParam: class Container { A a; } class A { String…
Benjamin M
  • 23,599
  • 32
  • 121
  • 201
1
2 3
18 19