I am new to Spring, so this should be simple, but I searched everywere and still have no solution:
I want to invoke a service that validates a value inside the validation method of the model bean, but autowire doens't work there.. So I got this service class:
And my model:Code:@Service("globalServices") public class GlobalServices { .... @Autowired private ValidaNIBSP validaNIBSP; public String validaNIB (...) { return validaNIBSP.execute(...); } ...
Autowire globalServices doesn't work, because the bean SeguradoDTO is just de model associated with the form. So is not part of the ApplicationContext?Code:public class SeguradoDTO implements Serializable { ... // executed in validation of edicao view state public void validateEdicao(ValidationContext context) { MessageContext messages = context.getMessageContext(); messages.clearMessages(); ... globalServices.validaNIBSP(...); // how to make this possible????
Thanks for your help in advance.



Reply With Quote
