Get your CodeRanch badge!*
The moose likes Servlets and the fly likes Default Value of Text Element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Default Value of Text Element" Watch "Default Value of Text Element" New topic
Author

Default Value of Text Element

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15292
    
    6

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 "" ?


GenRocket - Experts at Building Test Data
ritchie diputado
Greenhorn

Joined: Sep 19, 2003
Posts: 5
the value will be "".
if textfield1 does not exist on the request the value will be null.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15292
    
    6

Perfect, that is what I was hoping for. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default Value of Text Element
 
Similar Threads
Updating the value of Text box
how to acces text box in same jsp
on lost focus of textbox. + JSP + Server side Validation.
on lost focus of textbox. + JSP + Server side Validation.
Using javascript in Struts