Hello all,
I have a problem using
Struts <html:text> tag.
How do I set maxlength property dynamically?
For example:
<html:text name="myForm" property="firstName" size="25" maxlength="30" />
I tried the following three ways:
(1) use <%= %>, it won't work.
import MyClass;
....
<html:text name="myForm" property="firstName" size="25" maxlength="<%=MyClass.FIRSTNAME_MAX_LENGTH%>" />
(2) Use <bean:message> tags, it won't work.
<html:text name="myForm" property="firstName" size="25" maxlength="<bean:message key="myPage.maxlength.firstnameMaxlength"/>" />
(3) Use <bean:write> tag, it also won't work.
<html:text name="myForm" property="firstName" size="25" maxlength="<bean:write name=\"myForm\" property="firstnameMaxLength"/>"/>
Any ideas?
Thank you!
Kate