This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 15286
    
    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 - A Test Data Generation Platform
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: 15286
    
    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
on lost focus of textbox. + JSP + Server side Validation.
on lost focus of textbox. + JSP + Server side Validation.
how to acces text box in same jsp
Using javascript in Struts
Updating the value of Text box