• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default Value of Text Element

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When processing a request in a servlet and I say
String text1 = request.getParameter("textfield1");
And textfield1 has no value, will text1 be null or "" ?
 
ritchie diputado
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the value will be "".
if textfield1 does not exist on the request the value will be null.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect, that is what I was hoping for. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic