Skip to content

Instantly share code, notes, and snippets.

@banterCZ
Created February 11, 2013 12:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banterCZ/4754235 to your computer and use it in GitHub Desktop.
Save banterCZ/4754235 to your computer and use it in GitHub Desktop.
Fix of java.lang.IndexOutOfBoundsException using Spring MVC.
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
/**
* @author banterCZ
*/
@Controller
public class MyController {
@Value("${myApplication.autoGrowCollectionLimit:1000}")
private int autoGrowCollectionLimit;
/**
* {@link org.springframework.validation.DataBinder#DEFAULT_AUTO_GROW_COLLECTION_LIMIT} is only 256,
* but there are much more items.
* @param dataBinder
*/
@InitBinder
public void initBinder(WebDataBinder dataBinder) {
dataBinder.setAutoGrowCollectionLimit(autoGrowCollectionLimit);
}
//TODO
}
@serivires
Copy link

thank you. I have resolved in your favor.

@okashirin
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment