RequestParam « MVC « Spring Q&A





1. spring mvc annotation @RequestAttribute similar to @RequestParam    stackoverflow.com

I would like add an annotation similar to @RequestParam, though have it pull the values from the request attribute rather than the request param... Is there an example or explanation how to ...

2. Spring @MVC and @RequestParam validation    stackoverflow.com

I would like to use the @RequestParam annotation like so:

@RequestMapping
public void handleRequest( @RequestParam("page") int page ) {
   ...
}
However, I want to show page 1 if the user fiddles with ...

3. learning Spring's @RequestBody and @RequestParam    stackoverflow.com

So I'm editing a web project that uses spring and I need to start adding some of spring's annotations. Two of the ones I need to add are @RequestBody and ...

4. What should i use i if need a custom converter when using @RequestParam?    stackoverflow.com

I if have a method signature as follows

public void deposit(@RequestParam("accountId") Integer accountId, 
                   ...

5. In a Spring 3.0 GET request, what's the difference between a @PathVariable and a @RequestParam    stackoverflow.com

In an example such as the following, what's the difference between a @PathVariable and a @RequestParam?

@RequestMapping(value = "/portfolio/{portfolioIdPath}", method = RequestMethod.GET)
public final String portfolio(HttpServletRequest request, ModelMap model, 
@PathVariable long portfolioIdPath, @RequestParam ...

6. Binding a list in @RequestParam    stackoverflow.com

I'm sending some parameters from a form in this way:

myparam[0]     : 'myValue1'
myparam[1]     : 'myValue2'
myparam[2]     : 'myValue3'
otherParam    ...

7. Spring @RequestParam doesn't handle multiple variables correctly - example test case    stackoverflow.com

The test case given below shows a simple case where I have 2 parameters paramA and paramB.

  • If I call the /paramtest url the paramtest() method is called.
  • If I enter true ...

8. Is there a way to map a Spring 3.0 MVC @RequestParam directly to a Java Bean?    stackoverflow.com

Can this somehow work? do I have to use @InitBinder somehow?

public String myActionHandler(ModelMap model, @RequestParam MyPojoBean myBean){
    ...
}
  1. I'm sure I've seen this somewhere, but I'm not sure where. Is there ...

9. Spring MVC: @RequestParam validation    stackoverflow.com

In my register form i'm using Bean Validator (JSR-303) for validate User object, and need to validate separately password confirmation, because it is not a member of User. I have a ...





10. Custom @RequestParam type handler    stackoverflow.com

Simple and short question: Is there a way to create a handler for custom @RequestParam types in Spring MVC? I know I can register custom WebArgumentResolvers but then I cannot bind these ...

11. Java spring @RequestParam JSP    stackoverflow.com

current controller code:

    @RequestMapping(value = "/city", method = RequestMethod.POST)
public String getWeather(@RequestParam("city") int city_id,
               ...

12. @RequestParam is null when accessed in @ModelAttribute method    stackoverflow.com

I am using am working on a project where users can choose to either start with a new form submission, or continue with a form submission that they had started previously. ...

13. List of Objects as RequestParam in Spring MVC    stackoverflow.com

I want to send a list of object id's (generated by the user selecting checkboxes) by POST to an action, so I can get a java.util.List<MyObject> converted using an MyObjectEditor. So, is ...

14. Spring 3 - What's the standard way of sending @RequestParam values back to the view?    stackoverflow.com

I have a simple controller that handles a submit with a couple of parameters, not so much that I would consider creating a command object to store them. In my controller I ...

15. Validating @RequestParam in Spring 3 MVC    stackoverflow.com

How do I validate Spring @RequestParam so that they are in BindingResult with out having to use some sort of POJO transfer object (@ModelAttribute)? I could use MapBindingResult and put the request ...

16. Abstract classes and Spring MVC @ModelAttribute/@RequestParam    stackoverflow.com

I have a hierarchy of model classes in my Spring/Hibernate application. When submitting a POST form to a Spring MVC controller, is there any standard way of specifying the type of the ...





17. @RequestParam validation    stackoverflow.com

Is there a way to validate request parameter with spring without checking it in every function? For example, every method in a controller produces list of elements and each method accept 'from' ...

18. @RequestParam variables return a set of comma separated values, when a method gets called several times    stackoverflow.com

I just noticed that a @RequestParam variable that I use to check POST params, such as usernames, or ids, behaves rather strangely when the controller method gets called consecutive times. Rather ...

19. Spring MVC @PathVariable and @RequestParam blank/empty in JSP view    stackoverflow.com

I'm new to Spring 3 (3.0.6) and have been trying to get an incredibly simple controller/view set up, and just can't make it work. In my web.xml, I've defined a <servlet> ...

20. MVC: @RequestParam, HttpServletRequest ... Advantages/Disadvantages?    forum.springsource.org

MVC: @RequestParam, HttpServletRequest ... Advantages/Disadvantages? Hello, Ive got one question. Im working with Spring Framework and Spring MVC. I have a formular, which is filled out by an user. Per click ...

21. List of Objects as RequestParam in Spring MVC    forum.springsource.org

22. Filtering @RequestParam in spring mvc    forum.springsource.org

Filtering @RequestParam in spring mvc Hii all, i don't undetstand how can i filter RequestParam if the user trying direct access through url. Example if i have a controller like this ...

23. Spring MVC @RequestParam    forum.springsource.org

Spring MVC @RequestParam Hi, I'm new to Spring MVC so I may have missed it but I can't find any syntax for biinding variable request parameters to a java vararg . ...

24. use @ModelAttribute @PathVariable OR @ModelAttribute @RequestParam together    forum.springsource.org

Hi, I am using Spring MVC 3. In my method I need to access a variable, say zipCode, whether that variable exist in the @ModelAttribute or @PathVariable but following line doesn't ...