3
예 :Struts에서 Boolean에 대해 null을 수신하려면 어떻게해야합니까?
class TestAction
{
@Getter @Setter
Boolean enabled;// null for both
}
<input type='radio' name="enabled" value='true'> enabled
<input type='radio' name="enabled" value='false'> disabled
<input type='radio' name="enabled" value='null'> both
<!-- value=null will convert to false -->
가 어떻게 Boolean
에 null을 전달할 수 있습니다 HTML?
UPDATE
대답은 불가능하다. 아래의 다른 방법을 사용합니다.
둘 다 비어있는 값을 사용해 보셨습니까? – Remi878
http://stackoverflow.com/questions/22255612/how-to-preserve-null-state-in-a-boolean-sending-an-empty-string-from-jsp-to-acti –
'Boolean.valueOf ("") == false', 유일한 방법은 custom 값입니다. – wener