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:
@@ -51,6 +51,14 @@ public class FormTool
|
|||||||
_req = req;
|
_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
|
* Creates a text input field with the specified name and no extra
|
||||||
* arguments or default value.
|
* arguments or default value.
|
||||||
@@ -286,7 +294,7 @@ public class FormTool
|
|||||||
if (value) {
|
if (value) {
|
||||||
buf.append(" checked");
|
buf.append(" checked");
|
||||||
}
|
}
|
||||||
buf.append("/>");
|
buf.append(_closeBrace);
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +346,7 @@ public class FormTool
|
|||||||
if (value.equals(selectedValue)) {
|
if (value.equals(selectedValue)) {
|
||||||
buf.append(" checked");
|
buf.append(" checked");
|
||||||
}
|
}
|
||||||
buf.append("/>");
|
buf.append(_closeBrace);
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,7 +403,7 @@ public class FormTool
|
|||||||
if (!StringUtil.isBlank(extra)) {
|
if (!StringUtil.isBlank(extra)) {
|
||||||
buf.append(" ").append(extra);
|
buf.append(" ").append(extra);
|
||||||
}
|
}
|
||||||
buf.append("/>");
|
buf.append(_closeBrace);
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,4 +426,7 @@ public class FormTool
|
|||||||
|
|
||||||
/** A reference to the servlet request in use by this form tool. */
|
/** A reference to the servlet request in use by this form tool. */
|
||||||
protected HttpServletRequest _req;
|
protected HttpServletRequest _req;
|
||||||
|
|
||||||
|
/** The string used to close unmatched tags. */
|
||||||
|
protected String _closeBrace = "/>";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user