<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ludovic.praud" rel="nofollow">Ludovic Praud</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8375?redirect=false" rel="nofollow">SPR-8375</a></strong> and commented</p>
<p dir="auto"><strong>How to reproduce the problem</strong></p>
<p dir="auto">With a ModelAttribute such as :</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Model {
    List&lt;String&gt; getItems();
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">Model</span> {
    <span class="pl-smi">List</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-en">getItems</span>();
}</pre></div>
<p dir="auto">With a JSP such as :</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;form:input path=&quot;items[0]&quot; /&gt;"><pre class="notranslate">&lt;<span class="pl-ent">form</span><span class="pl-ent">:</span><span class="pl-ent">input</span> <span class="pl-e">path</span>=<span class="pl-s"><span class="pl-pds">"</span>items[0]<span class="pl-pds">"</span></span> /&gt;</pre></div>
<p dir="auto">within an HTML form.</p>
<p dir="auto">POST the form with modified items attribute :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="items[100000000]=foo"><pre class="notranslate"><code class="notranslate">items[100000000]=foo
</code></pre></div>
<p dir="auto">and wait, wait, wait until the OutOfMemoryException.</p>
<p dir="auto"><strong>Incriminated code</strong></p>
<p dir="auto"><code class="notranslate">org.springframework.validation.DataBinder.autoGrowNestedPaths</code> is default true, it should be false instead.</p>
<p dir="auto"><strong>Workarounds</strong></p>
<p dir="auto">In a controller :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.setAutoGrowNestedPaths(false);
}"><pre class="notranslate"><code class="notranslate">@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.setAutoGrowNestedPaths(false);
}
</code></pre></div>
<p dir="auto">or using an implementation of WebBindingInitializer :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public void initBinder(WebDataBinder binder, WebRequest request) {
    binder.setAutoGrowNestedPaths(false);
}"><pre class="notranslate"><code class="notranslate">public void initBinder(WebDataBinder binder, WebRequest request) {
    binder.setAutoGrowNestedPaths(false);
}
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109365" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12498" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12498/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12498">#12498</a> DataBinder should be able to define a different strategy for BeanWrapperImpl how autogrowing should handle gaps in collection properties (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 3 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=dmills" rel="nofollow">Darren Mills</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8282?redirect=false" rel="nofollow">SPR-8282</a></strong> and commented</p>
<p dir="auto">We have a WebSphere cluster configured with session replication between each node. In order to accomplish this, all objects that end up in the session must be Serializable. We are using the Joda Date/Time Converters in our domain objects which could be contained within a Web Form. Although all of OUR objects are Serializable, our production logs are complaining about the FormattingConversionService not being Serializable.  Another poster confirmed they are seeing the same exception and provided screenshots of their session attributes which included the FormattingConversionService.</p>
<p dir="auto">Possible solutions may be either making all ConversionService implementations serializable, or changing the Spring behavior of storing the service bean in session, for example, in ServletContext.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?p=359434" rel="nofollow">http://forum.springsource.org/showthread.php?p=359434</a></p>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/74b6a5b6d7892200b2d4ab8418421507ff4f0ba0/hovercard" href="https://github.com/spring-projects/spring-framework/commit/74b6a5b6d7892200b2d4ab8418421507ff4f0ba0"><tt>74b6a5b</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/9472025da708c78e22e00c246d893d90897f240e/hovercard" href="https://github.com/spring-projects/spring-framework/commit/9472025da708c78e22e00c246d893d90897f240e"><tt>9472025</tt></a></p>
<p dir="auto">7 votes, 14 watchers</p>