How to inject dependencies in Valang custom functions

If your custom function requires dependencies to be injected (like a DAO for example) just override one of the isAutowire... methods of org.springmodules.validation.valang.functions.AbstractFunction.

For example, if you add this to your custom function:

@Override
public boolean isAutowireByName() {
    return true;
}

Then Spring will autowire any dependencies by name.


CategoryProgramming

InjectValangFunctionDependencies (last edited 2008-02-10 15:13:28 by DavidKeen)