|
From: Matt R. <ma...@ra...> - 2004-04-24 19:27:47
|
Developers, Attached is a patch for the JavaScriptValidatorTag so that Spring's Commons Validator works like it does with Struts. I've tested it with JavaScript generated in the page, as well as using a JSP to generate a standalone JavaScript file. Code often speaks better than words: <html:javascript formName="user"/> - Generates a bunch of JavaScript methods in the current page (read from validator-rules.xml). OR: <html:javascript formName="user" staticJavascript="false"/> <script type="text/javascript" src="<c:url value="/scripts/validator.jsp"/>"></script> Where /scripts/validator.jsp is: <%@ page language="java" contentType="javascript/x-javascript" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <html:javascript dynamicJavascript="false" staticJavascript="true"/> I also patched build.xml so the .tld for commons-validator is included in spring.jar/META-INF. HTH, Matt |