-
Feb 23rd, 2012, 04:26 AM
#1
Configuring default value for @RequestParam using property(or other configuration
Hi all,
Is there a way to do this? for example, I have pagination parameters in my controller for eg
@RequestMapping(...)
public String myListMethod(@RequestParam("perPage", required=false, default="<some value from configuration>")int perPage, @RequestParam(...)int pageNumber) {...}
where I set the default based on some configuration parameter dynamically (property file/database lookup etc).
-
Feb 23rd, 2012, 06:15 AM
#2
You don't... I suggest using an object to encapsulate the properties (binding will be done automatically) and code the defaults in there (parameters that aren't send with the request aren't going to be overwritten).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules