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

后端 未结 3 670
名媛妹妹
名媛妹妹 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条回答
  •  Happy的楠姐
    2021-01-20 22:04

    Simple: If the parameter name is present, but value not, then it's empty. If the parameter name is absent as well, then it's null. You normally give fields a name, so it's present as request parameter and empty fields will be just come in as empty string.

提交回复
热议问题