FormTool
Deprecated: Form Builder / Legacy Forms
Recommendation
Use a content type to create a form; use the workflow viewtool or workflow API to ingest each submission as a new contentlet of that content type.
See How to Build A Schema Driven Form in dotCMS for a tutorial.
Reason
Original legacy form functionalities, such as the FormTool, depended on Struts components, removed years ago — version 5.2.0, back in 2019.
The successor, the Form Builder, has likewise aged out; it renders out-of-date (sometimes nonstandard) tags that frequently fall short of WCAG or other standards, and custom fields like a captcha are not possible. Given more coherent alternative methods outlined above, we deemed this feature no longer worth updating.
Viewtool to work with HTML forms in Struts.
Important:
dotCMS uses the Struts 1 Forever package, which fixes all known security issues with Apache Struts, and which is continually maintained and patched.
The following example shows how the FormTool viewtool is mapped in the toolbox.xml file:
<tool> <key>form</key> <scope>request</scope> <class>org.apache.velocity.tools.struts.FormTool</class> </tool>
Example#
This tool should only be used in the request scope.
<input type="hidden" name="com.dotcms.repackage.org.apache.struts.taglib.html.TOKEN" value="$form.token"> <input type="submit" name="com.dotcms.repackage.org.apache.struts.taglib.html.CANCEL" value="Cancel">