PDA

View Full Version : @RequestParam parameter types



lowellk
Dec 4th, 2009, 06:21 PM
I haven't found any docs which explain the exact types of method parameters which are annotated with @RequestParam. What types can be annotated? So far I can see that Java strings and some (all?) primitives can be used.

Also, is there a way to extend how this works? What I'd like to do would be to have a Foo class which has a parse() method and be able to annotate controller methods to take such a type. Is this at all possible? Here's an example of what I'd like to do:


@RequestMapping("/bar")
public void bar(@RequestParam Foo foo) {
// do something with foo
}

Thanks!

Lowell