Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring framework, module and Jakarta Commons

 
Jiafan Zhou
Ranch Hand
Posts: 193
Fedora Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am bit comfused about these 3 technologies.

1. Spring framework
2. Spring module (say 0.5 the latest version)
3. Jakarta Commons

What is the relationship between them?

I know that Spring modules provide added-on features for Spring framework..but what is the relationship between Jakarta Commons and them?

In my project, I used some sort of validation technique ( I think combined with these 3 things but not sure)..

Now what is the difference between
1. Spring framework validation..
2. Spring module validation..
3. Jakarta Commons validation..

They use different API, arent they? Is spring module validation use Jakarta Commons validations??

I need some explanation on this, Thank you in advance.

Kind Regards,
Jiafan
 
Jiafan Zhou
Ranch Hand
Posts: 193
Fedora Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anybody knows this?
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jiafan,

Spring MVC has a Validator interface, you provide an implementation, and Spring MVC will invoke the validator for you at a set time, for example on receiving a form submission.

Jakarta Commons Validator provides a validation framework where you can set up declarative validation of Javabeans.

Spring Modules (Validation) basically makes Jakarta Commons Validator available as a Spring Validator, so you can use it to validate Javabeans defined in your Spring configuration files.

Using Commons Validation with Spring for Declarative Validation by Matt Raible might make a good starting point for you.

HTH

Sonny
 
Jiafan Zhou
Ranch Hand
Posts: 193
Fedora Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cool stuff..

Another question I have, I am not validating a web application but a standalone application. So in that case, is it possible to use Jakarta commons and is there an example for that situation?

Kind regards,
Jiafan
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Spring Validator interface is not tied down to Spring MVC, so You can definitely use it in a standalone application.
The only difference would be that you will need to get a reference to the Validator and invoke the validate method yourself.

Perhaps something like -


If you do a search in Spring forums or documentation, you should be able to find some examples.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic