We're converting an older Struts 1.x app from HTML4 to XHTML1.1. To force compliance from the Struts tags, we're adding
<html:xhtml />
to the top of our JSPs.
After doing this, JSPs using
<html:form method="post" action="/foo.do" styleId="bar">
threw the following error:
Cannot specify "styleId" when in XHTML mode as the HTML "id" attribute is already used to store the bean name
I read that The solution is to remove the styleId and use the name of your form bean, as that will be inserted as the id in your HTML. We can take out the styleId, but when 2 forms on the same page submit to the same action, they end up with the same id and the XHTML is no longer valid!
Do we have any other options while still using Struts tags?