|
From: Daniel M. <mi...@pa...> - 2004-03-01 02:31:21
|
Hello everyone,
I have recently been working on a commons-validator extension/addition to
the Spring framework. My current implementation consists of a
org.springframework.validation.commons package with about six classes. It
provides an implementation of the org.springframework.validation.Validator
interface that would encapsulate the functionality of the commons validator.
A user's project could simply add the necessary commons-validator config
files (validator-rules.xml, validation.xml), jars (commons-validator.jar),
and wire up a few beans and have completely xml configured validation.
By the way, my implementation for Spring will be much handier than the
Struts validator: it will allow easy extension of the validator. A user
could simply wire up a custom validator with my Spring-commons-validator
object. The commons-validator could easily be invoked by the custom
validator. For instance, this provides a logical way for users to implement
complex validation routines in a custom validator and leave the boring stuff
to the commons-validator (required, int, date, etc). To get back to the
point, the only way to extend the validator in Struts is to (1) either code
pluggable validators for the commons validator or (2) add a validate()
method to your ActionForm that does the complex stuff. I don't like the
first approach because it's cumbersome and one must understand the innards
of the commons-validator to do it. The second approach usually ends up
adding unnecessary complexity to a form. Furthermore, if you're using
DynaValidatorForms you have to extend the DynaValidatorForm class to add
this functionality, which (imo) puts validation logic in a not-so-logical
location.
Now this may all be sounding fine and dandy, and you're all saying "OK.
Let's have a look at the code so we can see if we'd like to use it." or even
better "Hey, give us your code...we really need that." But there's a
catch...
Background Info
The commons-validator uses message resources to identify arguments (such as
field names) for validation messages. For example, the base message would be
error.required="{0} is required." and arg0="formName.fieldName.label" (or
any other message resource identifier). Upon validation failure, the
validator resolves this message resource identifier to its corresponding
message in order to add it to the arguments array for the Errors object
(ActionErrors in Struts). The Struts validator adds a request object to the
commons-validator's map of resources, so request attributes may be used in
validation methods. Hence, the validator has a way to access the locale of
the current request as well as message resources to resolve message resource
identifiers. Currently, the Validator interface in Spring only specifies the
command object and the errors object as arguments, so I have no way of
getting these resources.
Ideally, the validator should not have to worry about resolving message
resources--it should only do validation. However, the commons-validator not
only does this, but also provides for locale-specific validation
configurations, so it seems necessary to have such information.
I have come up with two possible solutions for this problem.
(1) Add another method to the Spring Validator interface with something like
the following method signature:
public void validate(javax.servlet.http.HttpServletRequest request,
java.lang.Object obj, Errors errors)
I don't like this because it depends on a web context. One of the things I
was hoping for was the ability to use the commons-validator to validate
business objects in the middle tier, instead of only for the web. Of course,
the new method could simply provide the Locale and MessageResources, which
would possibly solve that problem.
(2) Improve the handling of Errors objects to allow message resources to be
specified as arguments that would not be resolved to their corresponding
messages until reaching the view. I really like this solution, but I have
not thought it through completely. One more note: since the errorArgs
parameter is an array of Objects (not an array of Strings), maybe there
would be a way to use a "Message" object that would be resolved at a later
time, while preserving the current functionality of Strings that are used
directly as arguments. For all I know, there is already a way to do this (it
seems logical enough), and I just don't know about it. This J2EE stuff is so
hard to keep up with...
Please provide response, and I will attempt to accommodate (or at least
consider) any wishes that may be expressed pertaining to additional features
or other adjustments. One area that I know should be supported, but I have
not worked on yet is the WizardController (multiple pages/stages of
validation per bean/form). I believe the commons-validator already supports
this, so it should only be a matter of adding another class or so to my
package to allow such functionality.
Thank you,
Daniel Miller
P.S. Sorry for being so long winded. I'll shut up now until I hear back from
you. :)
|
|
From: Seth L. <se...@eh...> - 2004-03-01 18:59:51
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
| (2) Improve the handling of Errors objects to allow message resources
to be
| specified as arguments that would not be resolved to their corresponding
| messages until reaching the view. I really like this solution, but I have
| not thought it through completely. One more note: since the errorArgs
| parameter is an array of Objects (not an array of Strings), maybe there
| would be a way to use a "Message" object that would be resolved at a later
| time, while preserving the current functionality of Strings that are used
| directly as arguments. For all I know, there is already a way to do
this (it
| seems logical enough), and I just don't know about it. This J2EE stuff
is so
| hard to keep up with...
Daniel,
I asked the list this exact question last week! We're running into the
same problems. :)
I like your option (2). For a quick solution over here, we did this: if
the String in the errorArgs array is this: "${something.key}" then we
treated that as a message key. This is close to your proposal to place
Message objects into the errorArgs array.
I hope that helps.
Seth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAQ4U95EIB1scRes8RAtfZAKCEp0T69XvVBXfxg9d7YUJIqS68PQCcD5cY
vWqs9ssqri9zLhw9i1zSIZ4=
=2ubC
-----END PGP SIGNATURE-----
|
|
From: Seth L. <se...@eh...> - 2004-03-02 00:07:17
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | (2) Improve the handling of Errors objects to allow message resources to be | specified as arguments that would not be resolved to their corresponding | messages until reaching the view. I really like this solution, but I have | not thought it through completely. One more note: since the errorArgs | parameter is an array of Objects (not an array of Strings), maybe there | would be a way to use a "Message" object that would be resolved at a later | time, while preserving the current functionality of Strings that are used | directly as arguments. For all I know, there is already a way to do this (it | seems logical enough), and I just don't know about it. This J2EE stuff is so | hard to keep up with... | Daniel, Spring seems to have an interface that says "Hi, I'm a resolvable Message". This is similar to the Message object you propose above. http://www.springframework.org/docs/api/org/springframework/context/MessageSourceResolvable.html I'm now subclasses ResourceBundleMessageSource to search through the message args, look for MessageSourceResolvable, and resolve it. I'm specifically reimplementing the getMessageInternal method from AbstractMessageSource. That's a little ugly, but that seems to be the point where the MessageFormat is used. Hope that helps, Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAQ81F5EIB1scRes8RAqRiAJ46Xm6+uoI/J7ci/3trE5JDcv+/sACghEdE Gc6YPhbEalOzhAAkbSC/chE= =1VaR -----END PGP SIGNATURE----- |
|
From: Seth L. <se...@eh...> - 2004-03-02 00:40:42
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | (2) Improve the handling of Errors objects to allow message resources to be | specified as arguments that would not be resolved to their corresponding | messages until reaching the view. I really like this solution, but I have | not thought it through completely. One more note: since the errorArgs | parameter is an array of Objects (not an array of Strings), maybe there | would be a way to use a "Message" object that would be resolved at a later | time, while preserving the current functionality of Strings that are used | directly as arguments. For all I know, there is already a way to do this (it | seems logical enough), and I just don't know about it. This J2EE stuff is so | hard to keep up with... Daniel, I just posted a simple patch w/ unit test for the functionality we've discussed. Please review and see if it meets your needs. http://opensource.atlassian.com/projects/spring/secure/ViewIssue.jspa?key=SPR-56 Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAQ9Ua5EIB1scRes8RAjA6AJ4vfkVAqr7FSl0h/du+Yuob+pSzJwCfaZfO QBboOgIetd7TU2y+/pNUZ+Q= =fPxm -----END PGP SIGNATURE----- |
|
From: Daniel M. <mi...@pa...> - 2004-03-02 05:28:20
|
Seth, That looks great. This would make my validation support super easy to implement. You can grab my current source here: http://www.paonline.com/millerd/Spring-commons-validator_no-dependencies.zip I have not had time to write up a good example, tests, or complete the documentation. Hopefully I will be able to do this soon. Thanks, Daniel Original Message: ----------------------------------------------------- | (2) Improve the handling of Errors objects to allow message resources to be | specified as arguments that would not be resolved to their corresponding | messages until reaching the view. I really like this solution, but I have | not thought it through completely. One more note: since the errorArgs | parameter is an array of Objects (not an array of Strings), maybe there | would be a way to use a "Message" object that would be resolved at a later | time, while preserving the current functionality of Strings that are used | directly as arguments. For all I know, there is already a way to do this (it | seems logical enough), and I just don't know about it. This J2EE stuff is so | hard to keep up with... Daniel, I just posted a simple patch w/ unit test for the functionality we've discussed. Please review and see if it meets your needs. http://opensource.atlassian.com/projects/spring/secure/ViewIssue.jspa?key=SP R-56 Seth |
|
From: Daniel M. <mi...@pa...> - 2004-03-05 05:21:36
|
Seth and Keith, Did you get a chance to look at my commons-validator adaptor? I was wondering if you had any feedback? Feel free to tell me that it sucks, or that it was so elementary that you didn't want to waste any more time talking to me about it :) I don't know much about commons-attributes, but from what I've been picking up between the lines on your recent validator-related posts it's quite different from the commons-validator approach. The main difference seems to be that validation meta-data is expressed directly in the source of the bean to be validated, while the commons-validator approach uses the validation.xml file to hold all of that meta-data. Your attributes validator sounds a bit more powerful than the commons validator, but many of the objects that I want to validate are generated (by Middlegen) and I have no way of adding meta-data to the objects without modifying the generated code. Of course, I could just write a wrapper for each object that I want to validate, but I might as well just write a validator class for each object. That being said, I think there is room for both an attributes validator and a commons validator in the Spring framework. The main thing I am interested in knowing is the patch that you (Seth) posted to allow message resources to be nested (as arguments) in another message resource. Do you have any idea how soon this will make its way into a Spring release or should I just get the source and build it in for my own use? Thanks, Daniel -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Daniel Miller Sent: Tuesday, March 02, 2004 12:19 AM To: spr...@li... Subject: RE: [Springframework-developer] Commons-Validator for Spring Seth, That looks great. This would make my validation support super easy to implement. You can grab my current source here: http://www.paonline.com/millerd/Spring-commons-validator_no-dependencies.zip I have not had time to write up a good example, tests, or complete the documentation. Hopefully I will be able to do this soon. Thanks, Daniel Original Message: ----------------------------------------------------- | (2) Improve the handling of Errors objects to allow message resources to be | specified as arguments that would not be resolved to their corresponding | messages until reaching the view. I really like this solution, but I have | not thought it through completely. One more note: since the errorArgs | parameter is an array of Objects (not an array of Strings), maybe there | would be a way to use a "Message" object that would be resolved at a later | time, while preserving the current functionality of Strings that are used | directly as arguments. For all I know, there is already a way to do this (it | seems logical enough), and I just don't know about it. This J2EE stuff is so | hard to keep up with... Daniel, I just posted a simple patch w/ unit test for the functionality we've discussed. Please review and see if it meets your needs. http://opensource.atlassian.com/projects/spring/secure/ViewIssue.jspa?key=SP R-56 Seth ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Keith D. <kd...@cs...> - 2004-03-05 13:48:36
|
Daniel, I can take a look at it. I'm curious if it is feasible to use the same declarative validator design we're developing and apply another mechanism (adapter) for configuration from commons-validator's format. That'd be nice, because we could use the same framework for all sources of configuration. I know I am already doing this in my implementation on my system as I use Spring IoC for configuration, while Seth uses attributes. But that might prove to be too much work, and that your way is better overall. I really can't say yet. commons-validator handles javascript validation client-side, too, right? Your adapter enables that? I know that's one area we have not addressed. Keith ----- Original Message ----- From: "Daniel Miller" <mi...@pa...> To: <spr...@li...> Sent: Friday, March 05, 2004 12:10 AM Subject: RE: [Springframework-developer] Commons-Validator for Spring > Seth and Keith, > > Did you get a chance to look at my commons-validator adaptor? I was > wondering if you had any feedback? Feel free to tell me that it sucks, or > that it was so elementary that you didn't want to waste any more time > talking to me about it :) > > I don't know much about commons-attributes, but from what I've been picking > up between the lines on your recent validator-related posts it's quite > different from the commons-validator approach. The main difference seems to > be that validation meta-data is expressed directly in the source of the bean > to be validated, while the commons-validator approach uses the > validation.xml file to hold all of that meta-data. > > Your attributes validator sounds a bit more powerful than the commons > validator, but many of the objects that I want to validate are generated (by > Middlegen) and I have no way of adding meta-data to the objects without > modifying the generated code. Of course, I could just write a wrapper for > each object that I want to validate, but I might as well just write a > validator class for each object. That being said, I think there is room for > both an attributes validator and a commons validator in the Spring > framework. > > The main thing I am interested in knowing is the patch that you (Seth) > posted to allow message resources to be nested (as arguments) in another > message resource. Do you have any idea how soon this will make its way into > a Spring release or should I just get the source and build it in for my own > use? > > Thanks, > Daniel > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Daniel Miller > Sent: Tuesday, March 02, 2004 12:19 AM > To: spr...@li... > Subject: RE: [Springframework-developer] Commons-Validator for Spring > > > Seth, > > That looks great. This would make my validation support super easy to > implement. You can grab my current source here: > > http://www.paonline.com/millerd/Spring-commons-validator_no-dependencies.zip > > I have not had time to write up a good example, tests, or complete the > documentation. Hopefully I will be able to do this soon. > > Thanks, > Daniel > > > Original Message: ----------------------------------------------------- > > | (2) Improve the handling of Errors objects to allow message resources > to be > | specified as arguments that would not be resolved to their corresponding > | messages until reaching the view. I really like this solution, but I have > | not thought it through completely. One more note: since the errorArgs > | parameter is an array of Objects (not an array of Strings), maybe there > | would be a way to use a "Message" object that would be resolved at a later > | time, while preserving the current functionality of Strings that are used > | directly as arguments. For all I know, there is already a way to do > this (it > | seems logical enough), and I just don't know about it. This J2EE stuff > is so > | hard to keep up with... > > Daniel, > > I just posted a simple patch w/ unit test for the functionality we've > discussed. Please review and see if it meets your needs. > > http://opensource.atlassian.com/projects/spring/secure/ViewIssue.jspa?key=SP > R-56 > > > Seth > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Daniel M. <mi...@pa...> - 2004-03-08 03:53:15
|
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? 2. Constructing the JavaScript validation requires access to resources such as the validator resources (which are contained in my ValidatorFactory which is wired up in a Spring context) and message resources. How should I access these resources from the context of a tag library (how/where are they stored within the Spring webapp/page-context)? 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)? 4. Would it be advisable (a) to add another tag library (with a single tag) that allows web authors to incorporate the generated JavaScript into their pages? (b) to add another tag to the existing Spring taglib? (c) to use some other mechanism to get the JavaScript into the view? I am open to and will consider all input. Your response is greatly appreciated. Thank you, Daniel -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Keith Donald Sent: Friday, March 05, 2004 8:34 AM To: spr...@li... Subject: Re: [Springframework-developer] Commons-Validator for Spring Daniel, I can take a look at it. I'm curious if it is feasible to use the same declarative validator design we're developing and apply another mechanism (adapter) for configuration from commons-validator's format. That'd be nice, because we could use the same framework for all sources of configuration. I know I am already doing this in my implementation on my system as I use Spring IoC for configuration, while Seth uses attributes. But that might prove to be too much work, and that your way is better overall. I really can't say yet. commons-validator handles javascript validation client-side, too, right? Your adapter enables that? I know that's one area we have not addressed. Keith ----- Original Message ----- From: "Daniel Miller" <mi...@pa...> To: <spr...@li...> Sent: Friday, March 05, 2004 12:10 AM Subject: RE: [Springframework-developer] Commons-Validator for Spring > Seth and Keith, > > Did you get a chance to look at my commons-validator adaptor? I was > wondering if you had any feedback? Feel free to tell me that it sucks, or > that it was so elementary that you didn't want to waste any more time > talking to me about it :) > > I don't know much about commons-attributes, but from what I've been picking > up between the lines on your recent validator-related posts it's quite > different from the commons-validator approach. The main difference seems to > be that validation meta-data is expressed directly in the source of the bean > to be validated, while the commons-validator approach uses the > validation.xml file to hold all of that meta-data. > > Your attributes validator sounds a bit more powerful than the commons > validator, but many of the objects that I want to validate are generated (by > Middlegen) and I have no way of adding meta-data to the objects without > modifying the generated code. Of course, I could just write a wrapper for > each object that I want to validate, but I might as well just write a > validator class for each object. That being said, I think there is room for > both an attributes validator and a commons validator in the Spring > framework. > > The main thing I am interested in knowing is the patch that you (Seth) > posted to allow message resources to be nested (as arguments) in another > message resource. Do you have any idea how soon this will make its way into > a Spring release or should I just get the source and build it in for my own > use? > > Thanks, > Daniel > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Daniel Miller > Sent: Tuesday, March 02, 2004 12:19 AM > To: spr...@li... > Subject: RE: [Springframework-developer] Commons-Validator for Spring > > > Seth, > > That looks great. This would make my validation support super easy to > implement. You can grab my current source here: > > http://www.paonline.com/millerd/Spring-commons-validator_no-dependencies.zip > > I have not had time to write up a good example, tests, or complete the > documentation. Hopefully I will be able to do this soon. > > Thanks, > Daniel > > > Original Message: ----------------------------------------------------- > > | (2) Improve the handling of Errors objects to allow message resources > to be > | specified as arguments that would not be resolved to their corresponding > | messages until reaching the view. I really like this solution, but I have > | not thought it through completely. One more note: since the errorArgs > | parameter is an array of Objects (not an array of Strings), maybe there > | would be a way to use a "Message" object that would be resolved at a later > | time, while preserving the current functionality of Strings that are used > | directly as arguments. For all I know, there is already a way to do > this (it > | seems logical enough), and I just don't know about it. This J2EE stuff > is so > | hard to keep up with... > > Daniel, > > I just posted a simple patch w/ unit test for the functionality we've > discussed. Please review and see if it meets your needs. > > http://opensource.atlassian.com/projects/spring/secure/ViewIssue.jspa?key=SP > R-56 > > > Seth > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
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/ |
|
From: Cameron B. <ca...@da...> - 2004-03-08 11:52:57
|
I have written some javascript validation code that extends the WebWork2 validator system by creating client site javascript. I have been trying to find the time to extract out our application specific code from the system to allow it to be shared with the community. I am still willing to do this, and I have been working on this recently. Currently it is integrated into our custom freemarker marco based forms library, and using some javascript objects on the client. I will attempt to get the code online somewhere for people to have a look at. I don't know if it is useable with spring, but it may provide some food for thought. Thanks, Cameron. > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] > On Behalf Of Sam Newman > Sent: Monday, 8 March 2004 8:42 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Commons-Validator for Spring > > 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/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Daniel M. <mi...@pa...> - 2004-03-12 04:36:46
|
Thanks for your feedback Sam. I agree. I will talk to the Struts developers about what I'm doing before I include their code into the Spring project. I was also leaning toward a tag library. Does anyone have input on whether another tag should be added to the Spring taglib or should it be a totally separate taglib (just for javascript validation)? Thanks. Daniel -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Sam Newman Sent: Monday, March 08, 2004 5:42 AM To: spr...@li... Subject: Re: [Springframework-developer] Commons-Validator for Spring 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/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Matt R. <li...@ra...> - 2004-03-12 04:54:55
|
I've used the Struts Validator for a couple years now and I think it's great - especially since I can generate my validation.xml using XDoclet. In the coming months, I plan to learn more about Tapestry and WebWork. I'd love to have a validation system that I could use on Struts, Spring, Tapestry and WebWork. I guess I'm saying - I'd like to see a tag library that can be used with other MVC frameworks. I plan on using Spring with all these MVC options - so including it in the core also suits my needs. Matt On Mar 11, 2004, at 9:21 PM, Daniel Miller wrote: > Thanks for your feedback Sam. > > I agree. I will talk to the Struts developers about what I'm doing > before I > include their code into the Spring project. > > I was also leaning toward a tag library. Does anyone have input on > whether > another tag should be added to the Spring taglib or should it be a > totally > separate taglib (just for javascript validation)? > > Thanks. > Daniel > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Sam Newman > Sent: Monday, March 08, 2004 5:42 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Commons-Validator for Spring > > > 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/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Daniel M. <mi...@pa...> - 2004-04-06 03:55:55
|
Matt, The commons-validator adaptor for Spring is now in the sandbox on sf.net. I would be happy to hear your comments/criticisms. The tag library is totally separate, so you should be able to use this with any framework you please, although it depends on a Spring BeanFactory to find the validator resources. If there is a need, I suppose an alternative resource resolution strategy could be implemented to remove this dependency. The actual validation classes are fairly generic as well, so you shouldn't even need to configure Spring to use them (although you will need the spring jar with the Validator interface in it). Thanks, Daniel Miller -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Matt Raible Sent: Thursday, March 11, 2004 11:36 PM To: spr...@li... Subject: Re: [Springframework-developer] Commons-Validator for Spring I've used the Struts Validator for a couple years now and I think it's great - especially since I can generate my validation.xml using XDoclet. In the coming months, I plan to learn more about Tapestry and WebWork. I'd love to have a validation system that I could use on Struts, Spring, Tapestry and WebWork. I guess I'm saying - I'd like to see a tag library that can be used with other MVC frameworks. I plan on using Spring with all these MVC options - so including it in the core also suits my needs. Matt On Mar 11, 2004, at 9:21 PM, Daniel Miller wrote: > Thanks for your feedback Sam. > > I agree. I will talk to the Struts developers about what I'm doing > before I > include their code into the Spring project. > > I was also leaning toward a tag library. Does anyone have input on > whether > another tag should be added to the Spring taglib or should it be a > totally > separate taglib (just for javascript validation)? > > Thanks. > Daniel > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Sam Newman > Sent: Monday, March 08, 2004 5:42 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Commons-Validator for Spring > > > 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/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Matt R. <li...@ra...> - 2004-04-06 04:23:47
|
Thanks Daniel. I'll try to look at this w/in the next week. My goal is to convert an existing Struts app to use Spring's MVC framework with minimal changes. So far, I've got Struts Menu, the DisplayTag and Tiles working. All were pretty trivial. Next up - Action to Controller and Validation. I'm using XDoclet pretty heavily in my existing app - so I'm somewhat motivated to continue generating validation.xml from POJOs. I'll probably have to hack XDoclet to make this work - since it only works for ValidatorForms right now. Of course, after looking at the attributes stuff, they might actually be easier to use than XDoclet. The one advantage of XDoclet, however, is that the XML files are still generated, so stuff can be changed after compilation. As far as I understand the attributes stuff - it'll stay hardcoded in your class (no XML generation). Of course, I rarely change any of this stuff after compilation - but it is a nice option. Matt On Apr 5, 2004, at 9:58 PM, Daniel Miller wrote: > Matt, > > The commons-validator adaptor for Spring is now in the sandbox on > sf.net. I > would be happy to hear your comments/criticisms. The tag library is > totally > separate, so you should be able to use this with any framework you > please, > although it depends on a Spring BeanFactory to find the validator > resources. > If there is a need, I suppose an alternative resource resolution > strategy > could be implemented to remove this dependency. > > The actual validation classes are fairly generic as well, so you > shouldn't > even need to configure Spring to use them (although you will need the > spring > jar with the Validator interface in it). > > Thanks, > Daniel Miller > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Matt Raible > Sent: Thursday, March 11, 2004 11:36 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Commons-Validator for Spring > > > I've used the Struts Validator for a couple years now and I think it's > great - especially since I can generate my validation.xml using > XDoclet. In the coming months, I plan to learn more about Tapestry and > WebWork. I'd love to have a validation system that I could use on > Struts, Spring, Tapestry and WebWork. > > I guess I'm saying - I'd like to see a tag library that can be used > with other MVC frameworks. I plan on using Spring with all these MVC > options - so including it in the core also suits my needs. > > Matt > > On Mar 11, 2004, at 9:21 PM, Daniel Miller wrote: > >> Thanks for your feedback Sam. >> >> I agree. I will talk to the Struts developers about what I'm doing >> before I >> include their code into the Spring project. >> >> I was also leaning toward a tag library. Does anyone have input on >> whether >> another tag should be added to the Spring taglib or should it be a >> totally >> separate taglib (just for javascript validation)? >> >> Thanks. >> Daniel >> >> -----Original Message----- >> From: spr...@li... >> [mailto:spr...@li...]On >> Behalf >> Of Sam Newman >> Sent: Monday, March 08, 2004 5:42 AM >> To: spr...@li... >> Subject: Re: [Springframework-developer] Commons-Validator for Spring >> >> >> 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/ >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IBM Linux Tutorials >> Free Linux tutorial presented by Daniel Robbins, President and CEO of >> GenToo technologies. Learn everything from fundamentals to system >> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IBM Linux Tutorials >> Free Linux tutorial presented by Daniel Robbins, President and CEO of >> GenToo technologies. Learn everything from fundamentals to system >> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Seth L. <se...@eh...> - 2004-04-06 18:02:27
|
> generated, so stuff can be changed after compilation. As far as I > understand the attributes stuff - it'll stay hardcoded in your class (no > XML generation). Of course, I rarely change any of this stuff after > compilation - but it is a nice option. Matt, The commons-attributes stuff actually creates other classes to store the attributes in. So I guess you could change those generated classes after the fact, though it might not be too pretty. :) Seth |
|
From: Seth L. <se...@eh...> - 2004-03-08 18:26:55
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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: Daniel, This is great to see! I have a few requests: - - Make the javascript work with XHTML 1.0 Strict or >. Currently, Struts' javascript works with a <form> with a name attribute. The name attribute is deprecated. It's id now. - - Selectively include the javascript functions being used on the form. In Struts right now, if you choose to include Javascript validation, it includes every possible function. Good luck, and I'd love to help test it out. Keith has been working on some new APIs for validation, so they might be helpful. I think they are either in the RCP or sandbox. Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFATLcI5EIB1scRes8RAiTRAJ4yg5FaX7YMcTIHKjSybVH1WB3jqwCeLDyZ AJlkNlE1xImEtQlfEXYeqeE= =mC24 -----END PGP SIGNATURE----- |
|
From: Daniel M. <mi...@pa...> - 2004-03-12 04:36:46
|
Seth, Your first request: make it work with XHTML 1.0 Strict I'll have to look into that, but I doubt that I can make that change. I think you better go ask the developers of the commons-validator to do that. By the way, I expect JavaScript support to be better once the next version of the commons-validator comes out. It looks like the developers have spent more time integrating the JavaScript validation into the picture. However, it doesn't seem like there's much going on in the way of new development for the commons-validator. It seems like the developers are waiting on something (Struts 1.2 or 1.3??). Second: Only included the necessary JavaScript I know exactly what you mean. It makes for a huge glob of extra code that is mostly unneeded, which only makes your page size a lot bigger. I was hoping to only include the required functions, but I'm not sure how easy it would be to do. The code (from Struts) that constructs the JavaScript code does not look like it has been optimized. I have been testing my current implementation and can verify that it works, with the exception of the MessageResourceResolvable patch for the Spring core. Once that is out, I will package my validator in a jar (it really doesn't have any other major dependencies), and put it out for people to try. I am very pleased with how easy it is to add validation to any project--just simply add the ValidatorFactory and BeanValidator definitions in the AppContext, write your validation rules in validation.xml, add the corresponding message resources, and use the BeanValidator to validate your bean, it's really that simple. Daniel -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Seth Ladd Sent: Monday, March 08, 2004 1:10 PM To: spr...@li... Subject: Re: [Springframework-developer] Commons-Validator for Spring -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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: Daniel, This is great to see! I have a few requests: - - Make the javascript work with XHTML 1.0 Strict or >. Currently, Struts' javascript works with a <form> with a name attribute. The name attribute is deprecated. It's id now. - - Selectively include the javascript functions being used on the form. In Struts right now, if you choose to include Javascript validation, it includes every possible function. Good luck, and I'd love to help test it out. Keith has been working on some new APIs for validation, so they might be helpful. I think they are either in the RCP or sandbox. Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFATLcI5EIB1scRes8RAiTRAJ4yg5FaX7YMcTIHKjSybVH1WB3jqwCeLDyZ AJlkNlE1xImEtQlfEXYeqeE= =mC24 -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <ad...@tr...> - 2004-03-12 13:24:16
|
On 03-11-2004 23:21 -0500 Daniel Miller <mi...@pa...> wrote: > Your first request: make it work with XHTML 1.0 Strict I'll second that motion. I find it very unpleasant to realize that a taglib generates non-validating output into my carefully validated pages. > Second: Only included the necessary JavaScript Is it not possible to keep the majority of the Javascript in a separate .js file? This way it only gets loaded once? A. -- Adam Sherman Tritus CG Inc. +1 (613) 797-6819 http://www.tritus.ca/ |
|
From: Matt R. <li...@ra...> - 2004-03-12 13:56:17
|
> On 03-11-2004 23:21 -0500 Daniel Miller <mi...@pa...> wrote:
> > Your first request: make it work with XHTML 1.0 Strict
>
> I'll second that motion. I find it very unpleasant to realize
> that a taglib
> generates non-validating output into my carefully validated pages.
Actually, I've tested this with the current Commons Validator and the
JavaScript doesn't care if you have name="x" on your form or id="x". So
it's really just a question of whether other taglibs generate valid
<form> markup. Struts doesn't generate XHTML 1.0 Strict markup b/c of
the name vs. id attribute. Personally, I aimed for strict compliance
for about a year and found it was more trouble than it was worth.
Transitional works just as good and you still get well-formed XML. Any
reason you prefer Strict over Transitional?
>
> > Second: Only included the necessary JavaScript
>
> Is it not possible to keep the majority of the Javascript in
> a separate .js
> file? This way it only gets loaded once?
The validator in Struts has this capability. At the bottom of a form
you want to validate you just put:
<html:javascript formName="userForm" cdata="false"
dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript"
src="<c:url value="/scripts/validator.jsp"/>"></script>
Where /scripts/validator.jsp has:
<%@ page language="java" contentType="javascript/x-javascript" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
prefix="html" %>
<html:javascript dynamicJavascript="false" staticJavascript="true"/>
This pulls from validator-rules.xml and produces the following:
http://demo.raibledesigns.com/appfuse/scripts/validator.jsp
You'll have to likely save it to disk to see the contents.
Matt
|
|
From: <ad...@tr...> - 2004-03-12 14:05:16
|
On 03-12-2004 6:37 -0700 Matt Raible <li...@ra...> wrote: > Actually, I've tested this with the current Commons Validator and the > JavaScript doesn't care if you have name="x" on your form or id="x". So > it's really just a question of whether other taglibs generate valid > <form> markup. Struts doesn't generate XHTML 1.0 Strict markup b/c of > the name vs. id attribute. Personally, I aimed for strict compliance > for about a year and found it was more trouble than it was worth. > Transitional works just as good and you still get well-formed XML. Any > reason you prefer Strict over Transitional? One of the main reasons, so far, has been to allow use of XSLT to do refactoring. Obviously, not all projects benefit from this but I was working on an application with a huge number of pages and having validating XML was great. The second reason is JSP 2.0. The new applications we're developing right now are using JSP 2.0 and benefiting from cleaner templates. Since JSP 2.0 suppose matching namespaces to taglibs, using a validating editor allows you to almost completely eliminate any typos. *Really* nice. You can still screw-up your EL, mind you. A. P.S. External JS with Struts, thanks. -- Adam Sherman Tritus CG Inc. +1 (613) 797-6819 http://www.tritus.ca/ |
|
From: Seth L. <se...@eh...> - 2004-03-05 18:40:35
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel Miller wrote: | Seth and Keith, | | Did you get a chance to look at my commons-validator adaptor? I was | wondering if you had any feedback? Feel free to tell me that it sucks, or | that it was so elementary that you didn't want to waste any more time | talking to me about it :) Daniel, I took a look at it briefly. I think it's a wonderful idea. It's also nice because it will help prove the new interfaces being proposed for the validation system. I think your commons-validator should integrate perfectly into the system as an option for validation. | | I don't know much about commons-attributes, but from what I've been picking | up between the lines on your recent validator-related posts it's quite | different from the commons-validator approach. The main difference seems to | be that validation meta-data is expressed directly in the source of the bean | to be validated, while the commons-validator approach uses the | validation.xml file to hold all of that meta-data. That's correct. | | Your attributes validator sounds a bit more powerful than the commons | validator, but many of the objects that I want to validate are generated (by | Middlegen) and I have no way of adding meta-data to the objects without | modifying the generated code. Of course, I could just write a wrapper for | each object that I want to validate, but I might as well just write a | validator class for each object. That being said, I think there is room for | both an attributes validator and a commons validator in the Spring | framework. I agree. I'm not sure either is more powerful, just different ways to do it. If they all follow the same interface(s), then it fits with the Spring mindset. Just choose a different implementation and let IoC wire it up! | | The main thing I am interested in knowing is the patch that you (Seth) | posted to allow message resources to be nested (as arguments) in another | message resource. Do you have any idea how soon this will make its way into | a Spring release or should I just get the source and build it in for my own | use? I think Keith is looking into that and hopefully we'll get something added soon. Looking forward to the options! Seth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFASMYn5EIB1scRes8RAopIAJ4mnVTFnAVMevdtIgXWbrIYY8x1FACfSbJh 399P7qxijwtrUNELlxvFOtg= =I9Wj -----END PGP SIGNATURE----- |