Spring WS & Validator interceptor
- by mada
I have a endpoint mapping a webservice which is used to insert in the dabatabase some keywords:
@Transactional(readOnly = false,isolation= Isolation.SERIALIZABLE)
public Source saveKW(...).
The input is a request.
I would like to add an interceptor on the method in order to validate the parameters.
this one will read some values from the DB.
i would like that this interceptor is EMBED in the transaction declared for the endpoint (or this opposite). In other words, i want them to be in the same transaction.
Ideally im looking for something like this with annotation:
@Transactional(readOnly = false,isolation= Isolation.SERIALIZABLE)
@validator("KeyWordValidaor.class")
public Source saveKW(...)
where KeyWordValidaor will be class validating the parameters.
Have you any idea or short examples to implements this like this way or in a other real way?