|
From: <jue...@we...> - 2004-05-21 21:42:52
|
My personal take on the tag library topic, quoted from a comment on = Matt's Spring Live blog (see = http://www.jroller.com/page/raible?anchor=3Dsimplifying_spring_bind_in_js= ps = <http://www.jroller.com/page/raible?anchor=3Dsimplifying_spring_bind_in_j= sps> for the full context): " 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.=20 You can also put those 3 lines per field into 1 line, putting the bind = tag right before/after the input tag. Of course, this is still = significantly more verbose than the Struts tag library, but it doesn't = issue any HTML from within the tag. As Keith has noted, this is the = original design philosophy behind Spring's tag library: The template = defines each HTML character that gets issued to the browser; no need for = rendering Velocity templates from within a tag library like WebWork = does.=20 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.=20 There is also quite a lot of people who actually prefer having custom = tags that just issue dynamic values, leaving static HTML to the template = itself. Still, a remaining question is whether Spring should provide = HTML-issuing custom tags (JSP 2.0 tag files built on top of the bind = tag) in the standard distribution. If there is agreement on their = default contents, we might do this; after all, being JSP tag files, they = could be easily customized.=20 " As we're about to get into strategic issues and implementation details, = I suggest to move the discussion to the developer list. Juergen ________________________________ Von: spr...@li... im Auftrag von = Daniel Miller Gesendet: Do 20.05.2004 00:39 An: spr...@li... Betreff: RE: [Springframework-user] New technique for working with = <spring:bind> Seth, I'm sorry to say it, but I think you're a bit confused here. As I = understand it, the commandName property of the controller (Handler?) is used solely = to identify the command object in the view. As per the Spring javadoc for BaseCommandController: Exposed configuration properties name: commandName default: command description: the name to use when binding the instantiated command class = to the request The object is bound to the request using this name. It has no impact on = the actual class name of the object being bound to the session. XDoclet (I assume, but don't actually use it) and Commons-Validator Adapter use the _class_name_ of the object to respectively create and locate the form definition in validation.xml. As far as I know this has nothing to do = with the commandName property of BaseCommandController. As a solution to the reply you sent to Keith, just always use the = default value of the commandName property ("command"), which can be done by = simply not specifying a commandName in your bean definition in the Spring configuration file (*-servlet.xml). For reference (You replied to Keith with the following): > Even with the setNestedPath tag, you still need to specify the name of the command object in the JSP file. I'd like to only specify it in the Handler (or the XML for the Handler). Then, when the Handler is passing control off to the View (indirectly, but you get the idea), it would bind in a well known generic name to the name of the command object. For instance, the Model would contain: > model.put("nameFromHandlerConfigForCommandObject", command); > model.put("commandName", "nameFromHandlerConfigForCommandObject"); > This way, all JSPs would be able to always know the command object's name. If the Handler's config changes, the JSPs don't change. Plus, an added benefit would be the tags could default to working with the command object if no other path is specified. Now back to my reply: Currently, if you use the default value of commandName, you will end up = with this in each of your JSP's: <spring:bind path=3D"command.someProperty">...</spring:bind> I hope this didn't come across as too strongly, I'm just trying to help. Daniel Miller -----Original Message----- From: spr...@li... [mailto:spr...@li... = <mailto:spr...@li...> ]On Behalf Of Seth Ladd Sent: Wednesday, May 19, 2004 5:42 PM To: spr...@li... Subject: Re: [Springframework-user] New technique for working with <spring:bind> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | Out of curiosity, what led you to believe that this a requirement? I do not | remember this being a requirement, and I believe I am currently using = the | Commons-Validator adaptor for Spring with the default command name | (command). I apologize in advance if I have misled you in some way that has | caused extra work on your part. Am I going so crazy that I can't even | remember requirements of code that I wrote? hehe, well, from what I read in the code (I'll try to verify right now) it matches the command bean with its rules via the name. Otherwise, how else would it know which form bean to get from the xml file? Also, I could be missing some cool elite secret piece of code. :) Part of the puzzle is the xdoclet code that generates the validation.xml file. It generates the command bean names by using the class name. For instance, foo.bar.CommandBean becomes <form name=3D"commandBean"> OK, here is the code from BeanValidator (sandbox): /** * If <code>useFullyQualifiedBeanName</code> is false (default = value), * this function returns a string containing a short name for = the given * class (e.g. myBean for the class com.domain.test.MyBean). = Otherwise, it * returns the value returned by Class.getName(). * * @param clazz Class of the bean to be validated. * * @return String containing the bean name. */ protected String getBeanName(Class clazz) { String name =3D clazz.getName(); if (useFullyQualifiedBeanName) { return name; } else { int afterDot =3D name.lastIndexOf(".") + 1; String firstChar =3D name.substring(afterDot, = afterDot + 1).toLowerCase(); String otherChars =3D ""; if (afterDot + 1 <=3D name.length()) { // Get the rest of the bean name otherChars =3D name.substring(afterDot + = 1); } return firstChar + otherChars; } } This is called from the validate() method. I fear it's mere coincidence that it all works, because both this code and the xdoclet code make this same bean name assumption. No real chance to specify it yourself. Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3-nr1 (Windows XP) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org = <http://enigmail.mozdev.org>=20 iD8DBQFAq9SPKZsFSwtW+wIRAl6PAKCC7oC+nXlw9lM+BAL7EEsqLJzGbgCfe/qx M4eJ7VJzcQFmV030pqOmzKc=3D =3DFwem -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=3D2562&alloc_id=3D6184&op=3Dclick = <http://ads.osdn.com/?ad_id=3D2562&alloc_id=3D6184&op=3Dclick>=20 _______________________________________________ Springframework-user mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-user = <https://lists.sourceforge.net/lists/listinfo/springframework-user>=20 ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick = <http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick>=20 _______________________________________________ Springframework-user mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-user = <https://lists.sourceforge.net/lists/listinfo/springframework-user>=20 |
|
From: <jue...@we...> - 2004-05-22 11:49:26
|
Seth, =20 I do see what you intend setNestedPath for - I just feel that Matt has = "misused" it in his example: In his 2-input-field form, setNestedPath = complicates matters rather than simplifies it; this is definitely *not* = "the Spring version that requires less typing" (as Matt has put it). = Please read my initial post mainly as direct reaction to Matt's blog = entry rather than as critique of setNestedPath per se. =20 For a large number of input fields, setting a specific nested path in an = outer tag does indeed simplify things. But even more important is that = it allows for reuse of entire sub-forms, like Jon has pointed out with = his address example; that was what I had in mind with reusing bind tag = snippets. This usage is similar to setNestedPath on an Errors object = (which is where you got the original idea from, I assume). =20 Your "ideal looking page" is exactly what I envisage as optimal use of = JSP 2.0 with Spring! With such concise input field syntax, specifying = the nested path in an outer tag already makes sense for a small number = of fields - agreed. It might be worth designing a "form:form" tag (as = JSP 2.0 tag file) that sets the nested path (using setNestedPath = underneath) but also renders a corresponding HTML form tag, analogous to = Struts' "html:form". =20 So moving forward, I consider adding a setNestedPath-style tag to = Spring's standard tag library, possibly as "spring:nestedPath" (no "set" = in the name, analogous to "spring:htmlEscape"). This does make sense = both with and without JSP 2.0, so should be part of Spring's standard = (Java-coded) tag library, I guess. Multiple "spring:nestedPath" tags = could also be nested, building hierarchical nested paths. =20 Have you considered donating your "form" tag library (JSP 2.0 tag files) = to Spring? It's exactly what I had in mind with my suggestion in = yesterday's blog comment. It would be a welcome option in standard = Spring, and an excellent showcase for JSP 2.0 tag files: high-level = HTML-issuing tags (coded as tag files) built on lower-level value access = tags (classic Java-coded tags). =20 Such a form tag library coded as JSP 2.0 tag files is much preferable to = (Struts-style) classic Java-coded tags for each and every input field = type, IMO, mainly because it's so easy to customize. There is still no = HTML content in Java code -rather in JSP tag files. I believe that this = is a very viable alternative to WebWork's form tags that issue HTML = content from corresponding Velocity templates. =20 Spring 1.0.2 will be released on Monday, so we should avoid further new = functionality there. I plan to add "spring:nestedPath" for 1.0.3; it = would be great to already have a basic "form" tag file library in that = release too (or in 1.1 RC1)! A sample application that illustrates usage = of those tag files is a necessity (of course, that sample will require = JSP 2.0): maybe alternative JSP views for JPetStore's Spring web tier? =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Seth Ladd Gesendet: Sa 22.05.2004 00:02 An: spr...@li... Betreff: Re: [Springframework-developer] Re: [Springframework-user] New = technique for working with <spring:bind> -----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=3D"command"> First Name: <form:text name=3D"firstName"/> Last Name: <form:text name=3D"lastName" /> Address: <springx:setNestedPath path=3D"address"> Street1: <form:text name=3D"street1"/> Street2: <form:text name=3D"street2"/> ... </springx:setNestedPath> <input type=3D"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=3D =3DoMwA -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Matt R. <li...@ra...> - 2004-05-22 15:39:02
|
I agree that JSP 2.0 tag files for rendering form elements is a *very*=20= cool idea. Unfortunately, there will probably be some flack from the=20 community because it won't work on most of the containers out there. =20 However, I think it's a good thing - let's drag those suckers into=20 using JSP 2.0 and help them simplify their lives. ;-) Hopefully more=20 containers will start producing J2EE 1.4-compatible servers. To my=20 knowledge, only Tomcat, Resin and WebSphere support JSP 2.0. The one nice thing about the WW tags is that they can actually be used=20= in both Velocity templates or in JSP pages. I believe that's=20 accomplished with some Velocity magic that invokes JSP Tags. It would=20= be nice if whatever Spring develops (to simplify JSP forms) can also be=20= used to simplify Velocity forms. Matt On May 22, 2004, at 5:48 AM, j=FCrgen h=F6ller [werk3AT] wrote: > Seth, > > I do see what you intend setNestedPath for - I just feel that Matt has=20= > "misused" it in his example: In his 2-input-field form, setNestedPath=20= > complicates matters rather than simplifies it; this is definitely=20 > *not* "the Spring version that requires less typing" (as Matt has put=20= > it). Please read my initial post mainly as direct reaction to Matt's=20= > blog entry rather than as critique of setNestedPath per se. > > For a large number of input fields, setting a specific nested path in=20= > an outer tag does indeed simplify things. But even more important is=20= > that it allows for reuse of entire sub-forms, like Jon has pointed out=20= > with his address example; that was what I had in mind with reusing=20 > bind tag snippets. This usage is similar to setNestedPath on an Errors=20= > object (which is where you got the original idea from, I assume). > > Your "ideal looking page" is exactly what I envisage as optimal use of=20= > JSP 2.0 with Spring! With such concise input field syntax, specifying=20= > the nested path in an outer tag already makes sense for a small number=20= > of fields - agreed. It might be worth designing a "form:form" tag (as=20= > JSP 2.0 tag file) that sets the nested path (using setNestedPath=20 > underneath) but also renders a corresponding HTML form tag, analogous=20= > to Struts' "html:form". > > So moving forward, I consider adding a setNestedPath-style tag to=20 > Spring's standard tag library, possibly as "spring:nestedPath" (no=20 > "set" in the name, analogous to "spring:htmlEscape"). This does make=20= > sense both with and without JSP 2.0, so should be part of Spring's=20 > standard (Java-coded) tag library, I guess. Multiple=20 > "spring:nestedPath" tags could also be nested, building hierarchical=20= > nested paths. > > Have you considered donating your "form" tag library (JSP 2.0 tag=20 > files) to Spring? It's exactly what I had in mind with my suggestion=20= > in yesterday's blog comment. It would be a welcome option in standard=20= > Spring, and an excellent showcase for JSP 2.0 tag files: high-level=20 > HTML-issuing tags (coded as tag files) built on lower-level value=20 > access tags (classic Java-coded tags). > > Such a form tag library coded as JSP 2.0 tag files is much preferable=20= > to (Struts-style) classic Java-coded tags for each and every input=20 > field type, IMO, mainly because it's so easy to customize. There is=20 > still no HTML content in Java code -rather in JSP tag files. I believe=20= > that this is a very viable alternative to WebWork's form tags that=20 > issue HTML content from corresponding Velocity templates. > > Spring 1.0.2 will be released on Monday, so we should avoid further=20 > new functionality there. I plan to add "spring:nestedPath" for 1.0.3;=20= > it would be great to already have a basic "form" tag file library in=20= > that release too (or in 1.1 RC1)! A sample application that=20 > illustrates usage of those tag files is a necessity (of course, that=20= > sample will require JSP 2.0): maybe alternative JSP views for=20 > JPetStore's Spring web tier? > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag=20= > von Seth Ladd > Gesendet: Sa 22.05.2004 00:02 > An: spr...@li... > Betreff: Re: [Springframework-developer] Re: [Springframework-user]=20 > New technique for working with <spring:bind> > > > > -----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 -=20 > 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=20 > 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=3D"command"> > > First Name: <form:text name=3D"firstName"/> > Last Name: <form:text name=3D"lastName" /> > > Address: > <springx:setNestedPath path=3D"address"> > Street1: <form:text name=3D"street1"/> > Street2: <form:text name=3D"street2"/> > ... > </springx:setNestedPath> > > <input type=3D"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=3D > =3DoMwA > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle=20 > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle=20 > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id=9966&op=CCk > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <jue...@we...> - 2004-05-22 17:28:43
|
Regarding Velocity, there is actually a similar native technique: = Velocimacros can achieve more or less the same as JSP 2.0 tag files, in = a pretty similar style. IIRC, Darren is using Velocimacros exactly for = rendering form elements, just like Seth uses JSP 2.0 tag files. =20 I guess such simplifications for form building will always be specific = to a view technology. What we could do is ship both default JSP 2.0 tag = files *and* default Velocimacros for simplified form rendering, keeping = them as analogous as possible (fetching dynamic values via bind tags = respectively the RequestContext). =20 In both cases, Java code would not issue HTML; rather, the HTML code is = always kept in a template that allows for easy customization. I believe = that having such analogous solutions for both JSP 2.0 and Velocity (and = possibly FreeMarker) is quite promising. =20 There's also value in leveraging the respective native macro mechanism = of each view technology: This allows for natural integration without = special bridges, also avoiding the need to learn yet another macro = mechanism if you already know your view technology's native one. =20 You do have a point that JSP 1.x does not have such a native macro = mechanism. Of course, there's still the option of coding the form = elements directly (just like our current samples do), so those users are = by no means locked out. And as you say, it's a good reason for them to = upgrade to JSP 2.0 :-) =20 Whether or not to provide Java-coded form simplification tags for JSP = 1.2 is a question of tradeoff. For JSP 2.0, tag files are absolutely = preferable, so Java-coded tags for JSP 1.2 would be a completely = separate effort - even more extra effort if also attempting to provide a = customization option for the HTML code. =20 My personal point of view is that we should focus on providing good form = simplification macros for JSP 2.0 and Velocity / FreeMarker, and keep = recommending direct form elements with bind tags for JSP 1.2. Time is on = our side in that respect, inevitably leading to broader adoption of JSP = 2.0. =20 And of course, there's always the option of using Struts or WebWork on = top of a Spring middle tier. Particularly for JSP 1.1, Struts is a = compelling option, as its tags work there too. For JSP 1.2, both Struts = and WebWork are viable choices for scenarios where form simplification = macros are important. =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Matt Raible Gesendet: Sa 22.05.2004 17:38 An: spr...@li... Betreff: Re: [Springframework-developer] New technique for working with = <spring:bind> I agree that JSP 2.0 tag files for rendering form elements is a *very* cool idea. Unfortunately, there will probably be some flack from the community because it won't work on most of the containers out there.=20 However, I think it's a good thing - let's drag those suckers into using JSP 2.0 and help them simplify their lives. ;-) Hopefully more containers will start producing J2EE 1.4-compatible servers. To my knowledge, only Tomcat, Resin and WebSphere support JSP 2.0. The one nice thing about the WW tags is that they can actually be used in both Velocity templates or in JSP pages. I believe that's accomplished with some Velocity magic that invokes JSP Tags. It would be nice if whatever Spring develops (to simplify JSP forms) can also be used to simplify Velocity forms. Matt On May 22, 2004, at 5:48 AM, j=FCrgen h=F6ller [werk3AT] wrote: > Seth, > > I do see what you intend setNestedPath for - I just feel that Matt has > "misused" it in his example: In his 2-input-field form, setNestedPath > complicates matters rather than simplifies it; this is definitely > *not* "the Spring version that requires less typing" (as Matt has put > it). Please read my initial post mainly as direct reaction to Matt's > blog entry rather than as critique of setNestedPath per se. > > For a large number of input fields, setting a specific nested path in > an outer tag does indeed simplify things. But even more important is > that it allows for reuse of entire sub-forms, like Jon has pointed out > with his address example; that was what I had in mind with reusing > bind tag snippets. This usage is similar to setNestedPath on an Errors > object (which is where you got the original idea from, I assume). > > Your "ideal looking page" is exactly what I envisage as optimal use of > JSP 2.0 with Spring! With such concise input field syntax, specifying > the nested path in an outer tag already makes sense for a small number > of fields - agreed. It might be worth designing a "form:form" tag (as > JSP 2.0 tag file) that sets the nested path (using setNestedPath > underneath) but also renders a corresponding HTML form tag, analogous > to Struts' "html:form". > > So moving forward, I consider adding a setNestedPath-style tag to > Spring's standard tag library, possibly as "spring:nestedPath" (no > "set" in the name, analogous to "spring:htmlEscape"). This does make > sense both with and without JSP 2.0, so should be part of Spring's > standard (Java-coded) tag library, I guess. Multiple > "spring:nestedPath" tags could also be nested, building hierarchical > nested paths. > > Have you considered donating your "form" tag library (JSP 2.0 tag > files) to Spring? It's exactly what I had in mind with my suggestion > in yesterday's blog comment. It would be a welcome option in standard > Spring, and an excellent showcase for JSP 2.0 tag files: high-level > HTML-issuing tags (coded as tag files) built on lower-level value > access tags (classic Java-coded tags). > > Such a form tag library coded as JSP 2.0 tag files is much preferable > to (Struts-style) classic Java-coded tags for each and every input > field type, IMO, mainly because it's so easy to customize. There is > still no HTML content in Java code -rather in JSP tag files. I believe > that this is a very viable alternative to WebWork's form tags that > issue HTML content from corresponding Velocity templates. > > Spring 1.0.2 will be released on Monday, so we should avoid further > new functionality there. I plan to add "spring:nestedPath" for 1.0.3; > it would be great to already have a basic "form" tag file library in > that release too (or in 1.1 RC1)! A sample application that > illustrates usage of those tag files is a necessity (of course, that > sample will require JSP 2.0): maybe alternative JSP views for > JPetStore's Spring web tier? > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag > von Seth Ladd > Gesendet: Sa 22.05.2004 00:02 > An: spr...@li... > Betreff: Re: [Springframework-developer] Re: [Springframework-user] > New technique for working with <spring:bind> > > > > -----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=3D"command"> > > First Name: <form:text name=3D"firstName"/> > Last Name: <form:text name=3D"lastName" /> > > Address: > <springx:setNestedPath path=3D"address"> > Street1: <form:text name=3D"street1"/> > Street2: <form:text name=3D"street2"/> > ... > </springx:setNestedPath> > > <input type=3D"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=3D > =3DoMwA > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id(tm)66&op=CCk > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <jue...@we...> - 2004-05-22 17:55:24
|
Furthermore, Velocimacros - and therefore form simplification macros for = Velocity that we might provide out-of-the-box - are available even for = Servlet 2.2 (JSP 1.1) containers. So for older containers, Velocity will = become an even more compelling choice as view technology, once we = provide such default form macros. =20 http://jakarta.apache.org/velocity/user-guide.html#Velocimacros = <http://jakarta.apache.org/velocity/user-guide.html#Velocimacros>=20 =20 FreeMarker actually offers a macro mechanism very similar to Velocity's. = Therefore, we should be available to provide analogous form = simplification macros for FreeMarker - again, leveraging its native = macro mechanism. Actually, the syntax is so similar to Velocity that we = might be able to use the same set of macro files... =20 http://www.freemarker.org/docs/dgui_misc_userdefdir.html = <http://www.freemarker.org/docs/dgui_misc_userdefdir.html>=20 =20 Any volunteers for those 3 form macro sets? :-) Maybe Seth for JSP 2.0? = Darren for Velocity, maybe also for FreeMarker? I'll care for overall = consistency. Target milestone could already be Spring 1.0.3 (end of = June), but 1.1 RC1 (end of August) would be good enough too. =20 BTW, thanks, everybody, for all your input! =20 Juergen =20 ________________________________ Von: j=FCrgen h=F6ller [werk3AT] Gesendet: Sa 22.05.2004 19:27 An: spr...@li... Betreff: Re: [Springframework-developer] New technique for working with = <spring:bind> Regarding Velocity, there is actually a similar native technique: = Velocimacros can achieve more or less the same as JSP 2.0 tag files, in = a pretty similar style. IIRC, Darren is using Velocimacros exactly for = rendering form elements, just like Seth uses JSP 2.0 tag files. =20 I guess such simplifications for form building will always be specific = to a view technology. What we could do is ship both default JSP 2.0 tag = files *and* default Velocimacros for simplified form rendering, keeping = them as analogous as possible (fetching dynamic values via bind tags = respectively the RequestContext). =20 In both cases, Java code would not issue HTML; rather, the HTML code is = always kept in a template that allows for easy customization. I believe = that having such analogous solutions for both JSP 2.0 and Velocity (and = possibly FreeMarker) is quite promising. =20 There's also value in leveraging the respective native macro mechanism = of each view technology: This allows for natural integration without = special bridges, also avoiding the need to learn yet another macro = mechanism if you already know your view technology's native one. =20 You do have a point that JSP 1.x does not have such a native macro = mechanism. Of course, there's still the option of coding the form = elements directly (just like our current samples do), so those users are = by no means locked out. And as you say, it's a good reason for them to = upgrade to JSP 2.0 :-) =20 Whether or not to provide Java-coded form simplification tags for JSP = 1.2 is a question of tradeoff. For JSP 2.0, tag files are absolutely = preferable, so Java-coded tags for JSP 1.2 would be a completely = separate effort - even more extra effort if also attempting to provide a = customization option for the HTML code. =20 My personal point of view is that we should focus on providing good form = simplification macros for JSP 2.0 and Velocity / FreeMarker, and keep = recommending direct form elements with bind tags for JSP 1.2. Time is on = our side in that respect, inevitably leading to broader adoption of JSP = 2.0. =20 And of course, there's always the option of using Struts or WebWork on = top of a Spring middle tier. Particularly for JSP 1.1, Struts is a = compelling option, as its tags work there too. For JSP 1.2, both Struts = and WebWork are viable choices for scenarios where form simplification = macros are important. =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Matt Raible Gesendet: Sa 22.05.2004 17:38 An: spr...@li... Betreff: Re: [Springframework-developer] New technique for working with = <spring:bind> I agree that JSP 2.0 tag files for rendering form elements is a *very* cool idea. Unfortunately, there will probably be some flack from the community because it won't work on most of the containers out there.=20 However, I think it's a good thing - let's drag those suckers into using JSP 2.0 and help them simplify their lives. ;-) Hopefully more containers will start producing J2EE 1.4-compatible servers. To my knowledge, only Tomcat, Resin and WebSphere support JSP 2.0. The one nice thing about the WW tags is that they can actually be used in both Velocity templates or in JSP pages. I believe that's accomplished with some Velocity magic that invokes JSP Tags. It would be nice if whatever Spring develops (to simplify JSP forms) can also be used to simplify Velocity forms. Matt On May 22, 2004, at 5:48 AM, j=FCrgen h=F6ller [werk3AT] wrote: > Seth, > > I do see what you intend setNestedPath for - I just feel that Matt has > "misused" it in his example: In his 2-input-field form, setNestedPath > complicates matters rather than simplifies it; this is definitely > *not* "the Spring version that requires less typing" (as Matt has put > it). Please read my initial post mainly as direct reaction to Matt's > blog entry rather than as critique of setNestedPath per se. > > For a large number of input fields, setting a specific nested path in > an outer tag does indeed simplify things. But even more important is > that it allows for reuse of entire sub-forms, like Jon has pointed out > with his address example; that was what I had in mind with reusing > bind tag snippets. This usage is similar to setNestedPath on an Errors > object (which is where you got the original idea from, I assume). > > Your "ideal looking page" is exactly what I envisage as optimal use of > JSP 2.0 with Spring! With such concise input field syntax, specifying > the nested path in an outer tag already makes sense for a small number > of fields - agreed. It might be worth designing a "form:form" tag (as > JSP 2.0 tag file) that sets the nested path (using setNestedPath > underneath) but also renders a corresponding HTML form tag, analogous > to Struts' "html:form". > > So moving forward, I consider adding a setNestedPath-style tag to > Spring's standard tag library, possibly as "spring:nestedPath" (no > "set" in the name, analogous to "spring:htmlEscape"). This does make > sense both with and without JSP 2.0, so should be part of Spring's > standard (Java-coded) tag library, I guess. Multiple > "spring:nestedPath" tags could also be nested, building hierarchical > nested paths. > > Have you considered donating your "form" tag library (JSP 2.0 tag > files) to Spring? It's exactly what I had in mind with my suggestion > in yesterday's blog comment. It would be a welcome option in standard > Spring, and an excellent showcase for JSP 2.0 tag files: high-level > HTML-issuing tags (coded as tag files) built on lower-level value > access tags (classic Java-coded tags). > > Such a form tag library coded as JSP 2.0 tag files is much preferable > to (Struts-style) classic Java-coded tags for each and every input > field type, IMO, mainly because it's so easy to customize. There is > still no HTML content in Java code -rather in JSP tag files. I believe > that this is a very viable alternative to WebWork's form tags that > issue HTML content from corresponding Velocity templates. > > Spring 1.0.2 will be released on Monday, so we should avoid further > new functionality there. I plan to add "spring:nestedPath" for 1.0.3; > it would be great to already have a basic "form" tag file library in > that release too (or in 1.1 RC1)! A sample application that > illustrates usage of those tag files is a necessity (of course, that > sample will require JSP 2.0): maybe alternative JSP views for > JPetStore's Spring web tier? > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag > von Seth Ladd > Gesendet: Sa 22.05.2004 00:02 > An: spr...@li... > Betreff: Re: [Springframework-developer] Re: [Springframework-user] > New technique for working with <spring:bind> > > > > -----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=3D"command"> > > First Name: <form:text name=3D"firstName"/> > Last Name: <form:text name=3D"lastName" /> > > Address: > <springx:setNestedPath path=3D"address"> > Street1: <form:text name=3D"street1"/> > Street2: <form:text name=3D"street2"/> > ... > </springx:setNestedPath> > > <input type=3D"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=3D > =3DoMwA > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id(tm)66&op=CCk > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <jue...@we...> - 2004-05-27 09:25:31
|
Any concrete suggestions on how to move forward with this? Seth? Darren? =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von j=FCrgen h=F6ller [werk3AT] Gesendet: Sa 22.05.2004 19:54 An: spr...@li... Betreff: Re: [Springframework-developer] New technique for working with = <spring:bind> Furthermore, Velocimacros - and therefore form simplification macros for = Velocity that we might provide out-of-the-box - are available even for = Servlet 2.2 (JSP 1.1) containers. So for older containers, Velocity will = become an even more compelling choice as view technology, once we = provide such default form macros. http://jakarta.apache.org/velocity/user-guide.html#Velocimacros = <http://jakarta.apache.org/velocity/user-guide.html#Velocimacros> FreeMarker actually offers a macro mechanism very similar to Velocity's. = Therefore, we should be available to provide analogous form = simplification macros for FreeMarker - again, leveraging its native = macro mechanism. Actually, the syntax is so similar to Velocity that we = might be able to use the same set of macro files... http://www.freemarker.org/docs/dgui_misc_userdefdir.html = <http://www.freemarker.org/docs/dgui_misc_userdefdir.html> Any volunteers for those 3 form macro sets? :-) Maybe Seth for JSP 2.0? = Darren for Velocity, maybe also for FreeMarker? I'll care for overall = consistency. Target milestone could already be Spring 1.0.3 (end of = June), but 1.1 RC1 (end of August) would be good enough too. BTW, thanks, everybody, for all your input! Juergen ________________________________ Von: j=FCrgen h=F6ller [werk3AT] Gesendet: Sa 22.05.2004 19:27 An: spr...@li... Betreff: Re: [Springframework-developer] New technique for working with = <spring:bind> Regarding Velocity, there is actually a similar native technique: = Velocimacros can achieve more or less the same as JSP 2.0 tag files, in = a pretty similar style. IIRC, Darren is using Velocimacros exactly for = rendering form elements, just like Seth uses JSP 2.0 tag files. I guess such simplifications for form building will always be specific = to a view technology. What we could do is ship both default JSP 2.0 tag = files *and* default Velocimacros for simplified form rendering, keeping = them as analogous as possible (fetching dynamic values via bind tags = respectively the RequestContext). In both cases, Java code would not issue HTML; rather, the HTML code is = always kept in a template that allows for easy customization. I believe = that having such analogous solutions for both JSP 2.0 and Velocity (and = possibly FreeMarker) is quite promising. There's also value in leveraging the respective native macro mechanism = of each view technology: This allows for natural integration without = special bridges, also avoiding the need to learn yet another macro = mechanism if you already know your view technology's native one. You do have a point that JSP 1.x does not have such a native macro = mechanism. Of course, there's still the option of coding the form = elements directly (just like our current samples do), so those users are = by no means locked out. And as you say, it's a good reason for them to = upgrade to JSP 2.0 :-) Whether or not to provide Java-coded form simplification tags for JSP = 1.2 is a question of tradeoff. For JSP 2.0, tag files are absolutely = preferable, so Java-coded tags for JSP 1.2 would be a completely = separate effort - even more extra effort if also attempting to provide a = customization option for the HTML code. My personal point of view is that we should focus on providing good form = simplification macros for JSP 2.0 and Velocity / FreeMarker, and keep = recommending direct form elements with bind tags for JSP 1.2. Time is on = our side in that respect, inevitably leading to broader adoption of JSP = 2.0. And of course, there's always the option of using Struts or WebWork on = top of a Spring middle tier. Particularly for JSP 1.1, Struts is a = compelling option, as its tags work there too. For JSP 1.2, both Struts = and WebWork are viable choices for scenarios where form simplification = macros are important. Juergen ________________________________ Von: spr...@li... im Auftrag = von Matt Raible Gesendet: Sa 22.05.2004 17:38 An: spr...@li... Betreff: Re: [Springframework-developer] New technique for working with = <spring:bind> I agree that JSP 2.0 tag files for rendering form elements is a *very* cool idea. Unfortunately, there will probably be some flack from the community because it won't work on most of the containers out there. However, I think it's a good thing - let's drag those suckers into using JSP 2.0 and help them simplify their lives. ;-) Hopefully more containers will start producing J2EE 1.4-compatible servers. To my knowledge, only Tomcat, Resin and WebSphere support JSP 2.0. The one nice thing about the WW tags is that they can actually be used in both Velocity templates or in JSP pages. I believe that's accomplished with some Velocity magic that invokes JSP Tags. It would be nice if whatever Spring develops (to simplify JSP forms) can also be used to simplify Velocity forms. Matt On May 22, 2004, at 5:48 AM, j=FCrgen h=F6ller [werk3AT] wrote: > Seth, > > I do see what you intend setNestedPath for - I just feel that Matt has > "misused" it in his example: In his 2-input-field form, setNestedPath > complicates matters rather than simplifies it; this is definitely > *not* "the Spring version that requires less typing" (as Matt has put > it). Please read my initial post mainly as direct reaction to Matt's > blog entry rather than as critique of setNestedPath per se. > > For a large number of input fields, setting a specific nested path in > an outer tag does indeed simplify things. But even more important is > that it allows for reuse of entire sub-forms, like Jon has pointed out > with his address example; that was what I had in mind with reusing > bind tag snippets. This usage is similar to setNestedPath on an Errors > object (which is where you got the original idea from, I assume). > > Your "ideal looking page" is exactly what I envisage as optimal use of > JSP 2.0 with Spring! With such concise input field syntax, specifying > the nested path in an outer tag already makes sense for a small number > of fields - agreed. It might be worth designing a "form:form" tag (as > JSP 2.0 tag file) that sets the nested path (using setNestedPath > underneath) but also renders a corresponding HTML form tag, analogous > to Struts' "html:form". > > So moving forward, I consider adding a setNestedPath-style tag to > Spring's standard tag library, possibly as "spring:nestedPath" (no > "set" in the name, analogous to "spring:htmlEscape"). This does make > sense both with and without JSP 2.0, so should be part of Spring's > standard (Java-coded) tag library, I guess. Multiple > "spring:nestedPath" tags could also be nested, building hierarchical > nested paths. > > Have you considered donating your "form" tag library (JSP 2.0 tag > files) to Spring? It's exactly what I had in mind with my suggestion > in yesterday's blog comment. It would be a welcome option in standard > Spring, and an excellent showcase for JSP 2.0 tag files: high-level > HTML-issuing tags (coded as tag files) built on lower-level value > access tags (classic Java-coded tags). > > Such a form tag library coded as JSP 2.0 tag files is much preferable > to (Struts-style) classic Java-coded tags for each and every input > field type, IMO, mainly because it's so easy to customize. There is > still no HTML content in Java code -rather in JSP tag files. I believe > that this is a very viable alternative to WebWork's form tags that > issue HTML content from corresponding Velocity templates. > > Spring 1.0.2 will be released on Monday, so we should avoid further > new functionality there. I plan to add "spring:nestedPath" for 1.0.3; > it would be great to already have a basic "form" tag file library in > that release too (or in 1.1 RC1)! A sample application that > illustrates usage of those tag files is a necessity (of course, that > sample will require JSP 2.0): maybe alternative JSP views for > JPetStore's Spring web tier? > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag > von Seth Ladd > Gesendet: Sa 22.05.2004 00:02 > An: spr...@li... > Betreff: Re: [Springframework-developer] Re: [Springframework-user] > New technique for working with <spring:bind> > > > > -----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=3D"command"> > > First Name: <form:text name=3D"firstName"/> > Last Name: <form:text name=3D"lastName" /> > > Address: > <springx:setNestedPath path=3D"address"> > Street1: <form:text name=3D"street1"/> > Street2: <form:text name=3D"street2"/> > ... > </springx:setNestedPath> > > <input type=3D"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=3D > =3DoMwA > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id(tm)66&op=CCk > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Seth L. <se...@eh...> - 2004-05-27 17:24:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jürgen höller [werk3AT] wrote: | Any concrete suggestions on how to move forward with this? Seth? Darren? I would love to see: - - <spring:nestedPath> - - tagfiles for common form elements + tag classes (possibly using velocity? want to provide backwards compatibility for JSP 1.2) - - the new functionality for <spring:bind path="subObject.*"/> I can submit the JSP form element tags. Do we want to provide backwards compatibility? If so, is velocity backed tag classes a good way to accomplish it? Thanks, really looking forward to it! Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3-nr1 (Windows XP) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAtiQyKZsFSwtW+wIRAlmkAKCFnrJ1f54PYXIuQX9wBrph8qoaZgCaAyXm 0F3OVQAXuTysglDNORv5e+w= =I0BX -----END PGP SIGNATURE----- |
|
From: Darren D. <da...@da...> - 2004-05-27 18:38:08
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 27 May 2004 10:23, j=FCrgen h=F6ller [werk3AT] wrote: > Any concrete suggestions on how to move forward with this? Seth? Darren? > > Juergen I can try to standardise some Velocity / FreeMarker form handling macros. = =20 With Velocity, the location of an external macro file is a configuration=20 issue whereas with FTL, it's just inlined into the template with an include= =20 directive. FTL is somewhat more powerful than VTL too so there may be=20 advantages to using FTL if additional power or expressiveness is required.= =20 IOW, each of the 3 view technologies will have slightly different=20 configuration requirements on a per-application basis, and functionality=20 may vary too. > BTW, thanks, everybody, for all your input! I take it that was a joke? :-) Sorry, I'd been skimming the lists for a few days and missed this thread=20 altogether! =2D --=20 Darren Davison Public Key: http://www.davison.uk.net/pages/key.htm =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAtjV+KLMLAN01aw0RAjBWAJ47EBwRXpU2GoR7bSLxPu6+t7KEmwCcCusd CsYM5vv6qVETolklEJgrNMY=3D =3D88zm =2D----END PGP SIGNATURE----- |
|
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----- |