my spring config:
my custom function :Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="profileValidator" class="org.springmodules.validation.valang.ValangValidator"> <property name="customFunctions"> <map> <entry key="doIt"> <value>com.mycompany.myproject.domain.DoItFunction</value> </entry> </map> </property> <property name="valang"> <value> <![CDATA[ { name : ? HAS LENGTH : 'Profile name is required' : 'required.profileName' } { name : ? IS BLANK OR length(?) <= 30 : 'Profile name must be no longer than {0} characters' : 'proflieName.length': 30 } ]]> </value> </property> </bean> </beans>
But when I enter profile name and click submit call only "valang" (check empty and length), but my custom function "DoItFunction" not call.Code:public class DoItFunction extends AbstractFunction { private ProfileManager profileManager; private final Log logger = LogFactory.getLog(getClass()); public void setProfileManager(ProfileManager profileManager) { this.profileManager = profileManager; } public DoItFunction(Function[] arguments, int line, int column) { super(arguments, line, column); logger.info("TEST HERE"); definedExactNumberOfArguments(1); } @Override public boolean isAutowireByType() { logger.info("TEST HERE2"); return true; } // The init() method will be called by Valang after the properties have been // autowired @Override public void init() throws Exception { logger.info("INIIIIIIIIIIIIIIIIII"); Assert.notNull(profileManager, "profileManager is requirede"); } @Override protected Object doGetResult(Object target) throws Exception { logger.info("!!!!!!!!!!!!!target=" + target); return null; } }


