<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=kris2008" rel="nofollow">Harikrishna Kollli</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5876?redirect=false" rel="nofollow">SPR-5876</a></strong> and commented</p>
<p dir="auto">The Inner tags not able to access the name of the command object via the  PageContext in partial page rendering using  the FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME, DEFAULT_COMMAND_NAME attribute. I am putting the name of the command bean into the model.</p>
<p dir="auto"><code class="notranslate">@RequestMapping</code>(value="/dashboard/hotels.action", method = RequestMethod.GET)<br>
public String hotelsHandler(<code class="notranslate">@ModelAttribute</code>("command") DashboardPresentationModel command, Model model)<br>
{</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    model.addAttribute(FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME, DEFAULT_COMMAND_NAME);
    model.addAttribute(DEFAULT_COMMAND_NAME,command);
    return &quot;locationDependent&quot;;
}"><pre class="notranslate"><code class="notranslate">    model.addAttribute(FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME, DEFAULT_COMMAND_NAME);
    model.addAttribute(DEFAULT_COMMAND_NAME,command);
    return "locationDependent";
}
</code></pre></div>
<p dir="auto">I get the below exception on page refresh</p>
<p dir="auto">java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'hotel' available as request attribute<br>
at org.springframework.web.servlet.support.BindStatus .&lt;init&gt;(BindStatus.java:141)<br>
at org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.getBindStatus(AbstractData BoundFormElementTag.java:175)<br>
at org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.getPropertyPath(AbstractDa taBoundFormElementTag.java:195)<br>
at org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.getName(AbstractDataBoundF ormElementTag.java:161)<br>
at org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.autogenerateId(AbstractDat aBoundFormElementTag.java:148)<br>
at org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.resolveId(AbstractDataBoun dFormElementTag.java:139)<br>
at org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.writeDefaultAttributes(Abs tractDataBoundFormElementTag.java:123)<br>
at org.springframework.web.servlet.tags.form.Abstract HtmlElementTag.writeDefaultAttributes(AbstractHtml ElementTag.java:380)<br>
at org.springframework.web.servlet.tags.form.SelectTa g.writeTagContent(SelectTag.java:199)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 M3</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=74021" rel="nofollow">http://forum.springsource.org/showthread.php?t=74021</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="398095921" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10544" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10544/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10544">#10544</a> Partial page refresh with form tag is not working (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=flicken" rel="nofollow">Noel Flicken</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4702?redirect=false" rel="nofollow">SPR-4702</a></strong> and commented</p>
<p dir="auto">Expected behavior:<br>
Context should be close()'d after end of test class execution</p>
<p dir="auto">Observed behavior:<br>
Context only closed when <code class="notranslate">@DirtiesContext</code> annotates method</p>
<p dir="auto">Multiple test classes can re-use the same context, which allows for faster test execution, so automatically closing a context after test class execution is probably not the best mechanism.</p>
<p dir="auto">However, there should be a way to annotate that a context should be close()'d after all tests in a test class are executed.</p>
<p dir="auto">Suggested fix:</p>
<ul dir="auto">
<li>allow <code class="notranslate">@DirtiesContext</code> to annotate class</li>
<li>add TestExecutionListener#destroyTestInstance</li>
</ul>
<p dir="auto">Willing to implementing, if given approval of design.</p>
<hr>
<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="398092648" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10068" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10068/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10068">#10068</a> ApplicationContext not closed when using <code class="notranslate">@ContextConfiguration</code> to implement integration tests (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398092014" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9978" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9978/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9978">#9978</a> Add a setDirty method to AbstractTestNGSpringContextTests</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398094206" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10311" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10311/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10311">#10311</a> Reload the application context for each test in a class with a class level annotation</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398066033" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6700" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6700/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6700">#6700</a> ANT does not call destroy-method after tests</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398092648" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10068" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10068/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10068">#10068</a> ApplicationContext not closed when using <code class="notranslate">@ContextConfiguration</code> to implement integration tests</li>
</ul>
<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/2dee54b78abaccd0a0b63e2dc763ae634291bd71/hovercard" href="https://github.com/spring-projects/spring-framework/commit/2dee54b78abaccd0a0b63e2dc763ae634291bd71"><tt>2dee54b</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/e77e070e7a697752ab9181e74ead1beed5e4e6d3/hovercard" href="https://github.com/spring-projects/spring-framework/commit/e77e070e7a697752ab9181e74ead1beed5e4e6d3"><tt>e77e070</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/77821845a7bfdeb442f4a6ad132099d1ad85b9dc/hovercard" href="https://github.com/spring-projects/spring-framework/commit/77821845a7bfdeb442f4a6ad132099d1ad85b9dc"><tt>7782184</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/0483cb5a3d0a7ecb8aa491a24bc522637c4aa5d9/hovercard" href="https://github.com/spring-projects/spring-framework/commit/0483cb5a3d0a7ecb8aa491a24bc522637c4aa5d9"><tt>0483cb5</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/8dec6af03885a2486a249f208674eae1556886b7/hovercard" href="https://github.com/spring-projects/spring-framework/commit/8dec6af03885a2486a249f208674eae1556886b7"><tt>8dec6af</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/1f087b412d2fccd589633dd002e64cf7b8aa881e/hovercard" href="https://github.com/spring-projects/spring-framework/commit/1f087b412d2fccd589633dd002e64cf7b8aa881e"><tt>1f087b4</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/51b8b99dfc4d3cfcd0b8d73cb476f5c74af600be/hovercard" href="https://github.com/spring-projects/spring-framework/commit/51b8b99dfc4d3cfcd0b8d73cb476f5c74af600be"><tt>51b8b99</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/f26e2e3d7bbd6f6a9798e553235bc17979327861/hovercard" href="https://github.com/spring-projects/spring-framework/commit/f26e2e3d7bbd6f6a9798e553235bc17979327861"><tt>f26e2e3</tt></a></p>
<p dir="auto">4 votes, 6 watchers</p>