Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value for @RequestParam [SPR-5237] #9911

Closed
spring-issuemaster opened this issue Oct 23, 2008 · 1 comment
Closed

Default value for @RequestParam [SPR-5237] #9911

spring-issuemaster opened this issue Oct 23, 2008 · 1 comment
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Oct 23, 2008

Kenny MacLeod opened SPR-5237 and commented

From #8915:

Kenny MacLeod added a comment - 13/Dec/07 12:05 PM
Alternatively, perhaps @RequestParam could take an optional "defaultValue" attribute? It'd have to be a string, subject to the same conversion rules as if the parameter had been present. This would work for primitives as well as reference types.

Connor Barry added a comment - 24/Oct/08 01:36 AM
I agree, a defaultValue attribute would be really helpful here, to mimic the set of functions in ServletRequestUtils that allow a default to be set if it's not present, for example:
ServletRequestUtils.getBooleanParameter(request, name, defaultVal)


Affects: 2.5 final

Issue Links:

  • #8915 optional boolean @RequestParam fails on missing parameter

Referenced from: commits 0012c1e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.