<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=egervari" rel="nofollow">Ken Egervari</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6989?redirect=false" rel="nofollow">SPR-6989</a></strong> and commented</p>
<p dir="auto">I have some code that purposefully puts "[" and "]" in the path, which eventually gets rendered to the id and name attributes on the input tag.</p>
<p dir="auto">Code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;@springForm.input type=type attributes=attributes path=path htmlEscape=&quot;true&quot; /&gt;&lt;br/&gt;"><pre class="notranslate"><code class="notranslate">&lt;@springForm.input type=type attributes=attributes path=path htmlEscape="true" /&gt;&lt;br/&gt;
</code></pre></div>
<p dir="auto">At a high level, it gets used like this:<br>
Code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;@form.text path=&quot;studentAnswer.answers[${chunk.text}]&quot; /&gt;"><pre class="notranslate"><code class="notranslate">&lt;@form.text path="studentAnswer.answers[${chunk.text}]" /&gt;
</code></pre></div>
<p dir="auto">Unfortunately, spring's tag library is removing the "[" and "]", so what is left over is a giant string value. I <strong>must</strong> use this pattern since this page has multiple input fields that are totally random based on the list of text chunks.</p>
<p dir="auto">Each form value is supposed to map to this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private Map&lt;String,String&gt; answers = new HashMap&lt;String, String&gt;();"><pre class="notranslate"><code class="notranslate">private Map&lt;String,String&gt; answers = new HashMap&lt;String, String&gt;();
</code></pre></div>
<p dir="auto">Of course, when the server tries to get the values, there are NPE's everywhere due to Spring's stupidity.</p>
<p dir="auto">How did this break? I was using plain html before, and I just recently switched over to the tag library because it was the only way to get multipart's working correctly. Otherwise, Spring didn't pass the MultipartFile object to the domain object. I tried everything, and this is what fixed it.</p>
<p dir="auto">Now that I have converted about 50 forms to use the tag library, I have finally arrived to the 1 outlier form that does not covert over successfully. Sigh.</p>
<p dir="auto">Please tell me how I can get this to work so I can get this production code launched.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.1</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=86199" rel="nofollow">http://forum.springsource.org/showthread.php?t=86199</a></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="398103974" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11672" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11672/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11672">#11672</a> AbstractDataBoundFormElementTag generates incorrect input name attribute when using indexed properties (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=guitarking117" rel="nofollow">Nick Williams</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6363?redirect=false" rel="nofollow">SPR-6363</a></strong> and commented</p>
<p dir="auto">Currently, Spring DAO has an org.springframework.dao.DuplicateKeyException that extends org.springframework.dao.DataIntegrityViolationException. This exception indicates that the specific data integrity violation was due to a unique key violation. It is very helpful in determining specific errors that occurred in an application.</p>
<p dir="auto">However, if I want to determine if a data integrity violation was due to a foreign key violation, I have to test e.getMessage().toLowerCase().contains("foreign key").</p>
<p dir="auto">I think Spring would be greatly improved if there were a ForeignKeyException that, by whatever way duplicate key violations are detected and thrown as a DuplicateKeyException, would be thrown if foreign key violations are detected.</p>
<p dir="auto">Let me know if you have any questions.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC2</p>