Don't display 'null' as the default value if we haven't got one, har!

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1191 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
eric
2003-08-12 18:31:21 +00:00
parent 171112143e
commit c27d22ae14
@@ -1,5 +1,5 @@
// //
// $Id: FormTool.java,v 1.8 2003/07/04 01:29:16 mdb Exp $ // $Id: FormTool.java,v 1.9 2003/08/12 18:31:21 eric Exp $
// //
// samskivert library - useful routines for java programs // samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne // Copyright (C) 2001 Michael Bayne
@@ -322,7 +322,11 @@ public class FormTool
{ {
String value = ParameterUtil.getParameter(_req, name, true); String value = ParameterUtil.getParameter(_req, name, true);
if (StringUtil.blank(value)) { if (StringUtil.blank(value)) {
value = String.valueOf(defaultValue); if (defaultValue == null) {
value = "";
} else {
value = String.valueOf(defaultValue);
}
} }
return HTMLUtil.entify(value); return HTMLUtil.entify(value);
} }