I'm using Spring Webflow for an application and I need to validate a model object outside of the "normal" webflow validation cycle. I'm using a separate validation class:
@Component
public class MyInfoValidator {
public void validateMyInfo(MyInfoView myInfo, ValidationContext context) {
MessageContext messages = context.getMessageContext();
[snip]
}
}
I'd like to call this same validation class from another part of my code and validate the object, but I need to create (or retrieve) a ValidationContext object.
Can anyone tell me how to do this? Is it floating around somewhere in one of the Webflow beans or do I have to create one from scratch?