|
From: Seth L. <se...@eh...> - 2004-05-21 22:00:36
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks Juergen for pointing out this post. | Actually, Seth's version does *not* require less typing: It just avoids repeating the command name. Without Seth's setNestedPath tag, you'll get the 3 lines per field, saying "command.firstName" respectively "command.lastName". I actually prefer the latter; I personally don't think that such a setNestedPath tag adds value - except for very repetitive forms where you reuse the same bind tag snippet for various command names. That's exactly why I would want it and use it. I don't want to repeat anything. The setNestedPath tag follows very closely the bind tag. That is, just helps with setting scope of a bean that bind is using. It's entirely optional, too. The bind tag works/should work just fine without it. I've found it very useful in developing our JSPs that use many fields, where many of the fields are withing nested objects. I still believe it saves typing for anything more than 2 fields. Also, it saves a chance for error, as I'm not repeating the command name over and over. Having said that... | | If someone wants to reuse bind tags with specific HTML portions, simply turn them into parameterizable snippets: for example, with JSP 2.0's tag files. It should be straightforward to define Struts-style "html:xxx" custom tags this way, using the bind tag (or RequestContext/Errors scriptlets) underneath. I think this is a viable alternative to WebWork's way of custom tags rendering Velocity templates, being equally powerful. That's exactly what I, and I suspect many, people are doing right now. I've wrapped the bind tag and the logic to render the HTML (for instance, select and option tags) inside a tag file. Using the struts-esque tag files + setNestedPath, I'm pretty close to very minimal JSP typing. I see setNestedPath as an optional, but extremely helpful tag when writing anything but the most simple JSP page. I then see a separate set of convinience tags/tag files that render HTML markup as a really nice value add that everyone will end up writing anyway. See the original wiki page that started this. There is a comment there that gives examples of these tag files. My ideal looking page (and what I'm using now): <springx:setNestedPath path="command"> First Name: <form:text name="firstName"/> Last Name: <form:text name="lastName" /> Address: <springx:setNestedPath path="address"> Street1: <form:text name="street1"/> Street2: <form:text name="street2"/> ... </springx:setNestedPath> <input type="submit"/> </springx:setNestedPath> Hope that helps. Thanks, Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3-nr1 (Windows XP) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFArnxpKZsFSwtW+wIRAvUmAJ92o8EtbvaoyqGBd+MJa7apQRisXgCeO72t PHxE0WKTDhfnnfi20RfGThA= =oMwA -----END PGP SIGNATURE----- |