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

后端 未结 3 673
名媛妹妹
名媛妹妹 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:20

    I think it's up to the browser, but in most cases it will be null. You should still allow for both cases.

    Edit:

    As noted in the comments, in most cases it will be the empty string.

提交回复
热议问题