Allow XHTML generation to be deactivated for Java's old skool HTML viewing

code.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1920 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2006-09-20 22:32:07 +00:00
parent 4fb11519a8
commit d68fdb8106
+14 -3
View File
@@ -51,6 +51,14 @@ public class FormTool
_req = req;
}
/**
* Used to deactivate XHTML generation for "old skool" Java HTML viewer.
*/
public void setUseXHTML (boolean useXHTML)
{
_closeBrace = useXHTML ? "/>" : ">";
}
/**
* Creates a text input field with the specified name and no extra
* arguments or default value.
@@ -286,7 +294,7 @@ public class FormTool
if (value) {
buf.append(" checked");
}
buf.append("/>");
buf.append(_closeBrace);
return buf.toString();
}
@@ -338,7 +346,7 @@ public class FormTool
if (value.equals(selectedValue)) {
buf.append(" checked");
}
buf.append("/>");
buf.append(_closeBrace);
return buf.toString();
}
@@ -395,7 +403,7 @@ public class FormTool
if (!StringUtil.isBlank(extra)) {
buf.append(" ").append(extra);
}
buf.append("/>");
buf.append(_closeBrace);
return buf.toString();
}
@@ -418,4 +426,7 @@ public class FormTool
/** A reference to the servlet request in use by this form tool. */
protected HttpServletRequest _req;
/** The string used to close unmatched tags. */
protected String _closeBrace = "/>";
}