Search code examples
tagsstruts-1

How to use maxlength on textarea in struts 1 html tag


In struts 1 tags for html:textarea here

I do not see a maxlength attribute. How can i restrict the user from entering more than 100 characters? Also why did struts 1 omit such a basic attribute?


Solution

  • Because this "basic attribute" wasn't even supported in IE before IE10, and was added in HTML 5.

    Struts 1 predates that by a significant margin, has been EOL'd, and hasn't seen a new release for some time. Bear in mind that Struts 1.2's last release was, what, 2006-ish?

    You may extract the TLD and modify it to allow arbitrary attributes under JSP 2.0:

    <dynamic-attributes>true</dynamic-attributes>