开发者

Spring 3 bind obscures real values of command object

开发者 https://www.devze.com 2023-01-16 18:37 出处:网络
I have a controller that allows users to add or e开发者_运维知识库dit an entity. I\'ve removed myForm.myEntity.name from myForm but spring still shows it when the spring:bind tag is used. See the exam

I have a controller that allows users to add or e开发者_运维知识库dit an entity. I've removed myForm.myEntity.name from myForm but spring still shows it when the spring:bind tag is used. See the example below:

The snippet below outputs a value:

<spring:bind path="myForm.myEntity.name">
<h1>${status.value}</h1>
</spring:bind>

The snippet below doesn't:

<c:out value="${myForm.myEntity.name}"/>

I would expect both items not to output a value.


Try looking for these items in the page or request scope. I believe that's where Spring-MVC has placed them, by default.

For example,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号