Struts form names October 11, 2007Posted by Phill in Struts.
Tags: form names, Struts
Fortunately, there’s an easy solution: each input element (i.e.,
<html:text>) has a “name” attribute which you can use to set the name of the form bean that you’re using. Do that for all of your input elements, and then replace
<html:form> with a conventional
<form> tag, and everything should work OK.
Of course, having to specify a form name is probably a rather unusual requirement, but just in case it helps someone I publish it here for posterity!
Note to self… August 31, 2007Posted by Phill in Struts.
Tags: required, Struts, validation
In Struts validation, if (for example) you want a field to be checked against a regex, and it must be specified, you need to use “required” as well as “mask”:
<field property="fieldName" depends="required,mask">
If you just use “mask” – like I did – the field won’t be required.
Yes, I know that was a stupid mistake, OK?