Is it possible to return multiple / variable error messages with a single (preferably Spring-based) custom annotation?

Spring MVC is designed to work with JSR-303, which is what those javax. Validation jars describe.

Spring MVC is designed to work with JSR-303, which is what those javax. Validation jars describe. Spring MVC validation should return error messages for every failed validation, even if those validations are grouped together in a single custom annotation.

static.springsource.org/spring/docs/3.0.....

Er, sorry, the comment about the jars (and the question itself, really) wasn't as clear as it should have been. I am wanting to apply annotations based on the conditions at runtime, which Spring does with the applyIf commands, however as far as I have seen the JSR-303 ones do not handle. Ideally I would like to determine which conditions to apply at runtime and then apply them, but the Spring annotations cannot be placed on the definition of the @interface itself, and I'm not sure whether or not they act as I want them to if placed on the method declarations as I did in CustomAnno.

– tommy jones Jun 3 at 20:10 Oh, and also you can't use 2 of the same annotation on an object, which also makes it difficult to use them conditionally (although I can sort of bypass things like length restrictions by using min/max/size/length/value). – tommy jones Jun 3 at 20:18 @Tommy. Gotcha.

Conditional validation with JSR is non-existent. However, you can group annotations together and still have Spring populate error messages for each failure within the group. As far as multiple conditions, I think you're on you're own, though that's a feature worth suggesting.

– Filip Jun 3 at 20:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions