Q:

Struts 2 + Disable Form Autocomplete

We need to use the equivalent of 'autocomplete' attribute in our jsp's and ftl's. We are currently using struts tags (struts2-core version 2.1.6) and i don't see any attribute within the struts 2 domain which would help us disable the autocompletion of form fields.
Any idea on how we can implement this feature?

A:

You could edit the struts2 tags... although I would just use jQuery to add autocomplete="false" to all the desired form elements. All struts2 UI tags have a class and id attribute. You could create a noComplete class, which the script will act on.

A:

Struts2 tags support dynamic attributes, which allow you to specify arbitrary attributes to JSP tags. I'm not sure when this support was added, so you may need to upgrade from 2.1.6 if it doesn't support it.
You can tell by looking in the struts-tags.tld. The <tag/> entries should contain the following:
<dynamic-attributes>true</dynamic-attributes>

