|
From: Sam N. <sam...@ma...> - 2004-03-08 10:58:11
|
Daniel Miller wrote: > To all, > > I am looking into implementing the JavaScript portion of the > Commons-Validator for Spring. I have a few questions on which I would > appreciate some feedback: > > 1. Rather than re-invent the wheel I was planning on using as much existing > code as possible to implement JavaScript validation for Spring. It turns out > that the Struts source contains a lot of the code that "constructs" the > JavaScript functions for the client. What are the policies for using code > from other open-source projects in Spring? Can I just rip a bunch of code > out of the Struts source and adapt it for Spring? Do I need to ask > permission first? No matter what the license says, I think it would be advisable to ask - some goodwill from the struts developers might well help the process. In fact the struts developers are known to be a big fan of their code being rebuilt as separate modules - the Jakarta commons projects started from code in struts 1.0 being moved into separate projects. Struts is licensed using the Apache license, as such their code can be used without problem as long as correct attribution is given - this amounts to stating in the code itself and the documentation where it came from. > 3. Would it be advisable to put the javascript generating code in the tag > library or in the ValidatorFactory (which holds the resources needed to > build the code; things like message resources would need to be passed in)? A tag library would be my preferred choice (I hate Java scriptlets in JSP pages - a maintenance nightmare) although I suspect that the tag would be a relatively thin wrapper over the ValidatorFactory itself. -- sam http://www.magpiebrain.com/ |