WebGraphics provides us with a nice url to some performance tests for writing tables with the DOM. There are 5 different methods listed, and you can execute each one in your browser and see how long each takes to execute. Nice!
There's an interesting discussion taking place on the struts-dev mailing list right now. Here's a couple excerpts:
I'd be really interested in your thoughts on the XDoclet work I've done, especially in the Struts Validator realm. I'm generating validation.xml completely, and also all the form bean definitions in our system. I also use XDoclet to process form beans for a one-time starter code generation of a JSP page (templated to our specific look and feel) for a specified form bean, as well as the resource properties that can be used as a starting point for the application resource properties for the field labels. Its amazing amount of generation just on the Struts-side of things, but we use XDoclet for even more than that too. [ Erik Hatcher ]
...
I think it is time to start packaging tools and generators with Struts to
help the developer -- either as standalone packages included for convenience, or integrated into the architecture of the package. It
would be interesting to explore how XDoclet fits in to this vision. [ Craig McClanahan ]
What exciting times! I can't wait to use XDoclet to generate the validation.xml
file for Roller - should be a great learning experience. I don't plan on writing a Struts ActionForm again now that we have XDoclet. Also, I have an update on Roller and XDoclet: Dave found this problem with XDoclet and Castor. It will be fixed in XDoclet 1.2 beta 3. So we wait...
Did you know that with XHTML Strict, a <form>
element can't have a name
attribute? Actually, the only required attribute is action
. But, if you do want to identify your form, then you have to use the id
attribute. The problem with this is that many of us web developers are used to referencing a form (with Javascript) with document.formName
. So as a service to my readers, if you do decide to XHTML 1.0 Strict, you will need to reference your forms (in Javascript) using one of the following syntaxes. For the sake of this example, pretend our form is named "webForm":
document.getElementById("webForm);
// assuming it's the first form on the page.
document.forms[0];
document.getElementsByTagName("form").item(0);
Of course, if you're trying to get the value <input> tag within your form, and that input has an id
attribute, you can just get that using document.getElementById("inputId");
.
You ask - what insired you to post this? Well, the Struts enhancement to produce XHTML-compliant code from the tag libraries. It was closed yesterday, and they seemed to have missed this - in other words, the <form>
still has a name
attribute. It'll be interesting to see how they resolve this. I'm hoping that Struts is not tied to the name
attribute at all, and the fix just requires a bunch of fixes to Javascript that is written (by the tags).