> 1) How could we implement the functionality of these customs tags > if Velocity is used as a view technology instead of JSP? > One proposal was to use the existing macro functionality. Other > ideas?
Maybe by fitting a way of using JSP to set those properties and then pass a bean facade to the Velocity's template context. This way JSP is used for scripting logic, Velocity for presentation and those of us that don't care about JSP and Struts do not have to pay the bill. > 2) Much effort has been invested into developing JSP custom tag > libs. Some of them have been proven to be very useful. For many > of the custom tag libs the source is openly available. It would > be very interesting if Velocity were able to use the > implementations of the existing custom tag libs. A superficial > investigation shows that this might be "quite" easy to achieve. > Any ideas on this? One of the strongest ideas behind Velocity is that logic should be kept separated from presentation. Taglibs are one way how logic is NOT separated from presentation in JSP. IMO, basically, the answer is the same as above. Script in JSP with the taglibs as they are and create facade beans that allow Velocity to use their functionality. Have fun, Paulo Gaspar http://www.krankikom.de http://www.ruhronline.de > -----Original Message----- > From: Gabriel Sidler [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 27, 2001 8:42 PM > > > "Hensley, Richard" wrote: > > > > I agree with Jon, Paulo, and Daniel. > > > > It sounds very cool on the outset, however it reminds me of my C++ days > > where default parameters caused so much confusion for programmers > > unfamiliar with the code base that they needed classes before they could > > even read the code. i.e. way to many magic tricks up the sleeve. > > > > -1 > > > > Please keep Velocity simple meaning easy to read a template, and easy to > > predict what a template will do because all the information is present. > > > > Richard Hensley > > To all the people that said no we don't need an "enhanced" macro > directive: > > This thread is missing the intention of the original poster. The > motivation > for the original post was the Struts/Velocity integration that has been > discussed in another thread. Let me try to summarize. > > Struts comes with some powerful JSP custom tag libs to support > the view designers. > These tag libs include, for example, a client side form > validation library > (check for required form input, check syntax of form input, check > value range > of form input, etc. etc.). If you have been following the Struts > mailing lists > you have seen, that people find these tags libs very > productivity-enhancing > for their projects. > > These custom tag libs are not the core of Struts, but I am > certain that many Struts > developers wouldn't want to miss them. If Velocity is to be > integrated with > Struts, we would have to provide a Velocity-based alternative. > > Now, the property of these custom tags is that they typically > have many parameters, > few of them are required, many are optional and have default values. Here > a simple example: > > <html:text property="mailingAddress.street" value="Clark St."/> > > This tag generate sa text input form field. It name is > "mailingAdress.street" > and its default value is "Clark St." This tag has another 25(!) > parameters. > You never need all of them, in many practical cases just a handfull. This > introduces the need/wish to have some kind of function/macro > calls with optional > parameters. > > Now, two interesting questions arise: > > 1) How could we implement the functionality of these customs tags > if Velocity > is used as a view technology instead of JSP? One proposal was to use the > existing macro functionality. Other ideas? (Remember: If we are going to > integrate with Struts we have to provide an alternative to the > custom tags lib. > Whether or not we should integrate with Struts is another question.) > > 2) Much effort has been invested into developing JSP custom tag > libs. Some of > them have been proven to be very useful. For many of the custom > tag libs the > source is openly available. It would be very interesting if > Velocity were able > to use the implementations of the existing custom tag libs. A superficial > investigation shows that this might be "quite" easy to achieve. > Any ideas on > this? > > Or, are you of the opinion that a Velocity/Struts integration is > fundamentally > a bad idea? > > Our team is using Struts in our projects today and would be very > interested to be > able to use Velocity instead of JSP as the view technology. > > Gabe > > -- > Gabriel Sidler > Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
