Are empty fields in form of JSP null or “”?

后端 未结 3 639
名媛妹妹
名媛妹妹 2021-01-20 21:25


When a form is passed in to a servlet are empty fields \"\" or null? So for example in a form where you have First name as a field and last name as a field
Dean

3条回答
  •  清酒与你
    2021-01-20 22:23

    It also depends on the server. JBoss will give you empty Strings, but WebSphere will give you null. It's a real PITA. I'm sure there's some standard out there that says one way or another (my money would be on JBoss being the correct implementation) but you should code for both possibilities.

提交回复
热议问题