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

With relation to [SPR-11126] problem converting empty parameter to List, #515

Closed
wants to merge 1 commit into from

Conversation

MoonJongMin
Copy link

We want to get a request parameter with the type of List in the Spring-mvc Controller class like below

SampleController.java
@RequestMapping(value = "/urlpath")
public void create(@RequestParam(value = "param") List<String> paramList) {
 ...
}

When invoking ".../urlpath?param=", We expect List<String> has size 1 with empty String value, but actually the size of List<String> is 0.

Actually StringUtils.commaDelimitedListToStringArray(String) method is a real worker, but the purpose of that method is to return the empty array in case of empty input(by java doc).
So, I slightly chnaged convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) method in the StringToCollectionConverter
class.

reated Issue:

I slightly chnaged convert(Object source, TypeDescriptor sourceType,
TypeDescriptor targetType) method in the StringToCollectionConverter
class.
@MoonJongMin
Copy link
Author

I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.

@philwebb
Copy link
Member

I don't think that we can apply this one in it's current form. See comments on 0cdc7df

@philwebb philwebb closed this Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants