marino 2004/02/18 15:34:50 Modified: src/java/org/apache/velocity/tools/struts ValidatorTool.java Log: applied patch (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26782) and cleaned out the commented out stuff. Revision Changes Path 1.9 +6 -82 jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/ValidatorTool.java Index: ValidatorTool.java =================================================================== RCS file: /home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/ValidatorTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ValidatorTool.java 18 Feb 2004 20:09:51 -0000 1.8 +++ ValidatorTool.java 18 Feb 2004 23:34:50 -0000 1.9 @@ -96,8 +96,6 @@ private boolean xhtml = false; - //private boolean staticJavascript = true; - //private boolean dynamicJavascript = true; private boolean htmlComment = true; private boolean cdata = true; private String formName = null; @@ -157,34 +155,8 @@ /****************** get/set accessors ***************/ /** - * Gets the key (form name) that will be used - * to retrieve a set of validation rules to be - * performed on the bean passed in for validation. - * - * @return the key (form name) - */ - /*public String getFormName() - { - return formName; - }*/ - - /** - * Sets the key (form name) that will be used - * to retrieve a set of validation rules to be - * performed on the bean passed in for validation. - * Specifying a form name places a - * <script> </script> tag around the javascript. - * - * @param formName the key (form name) - */ - /*public void setFormName(String formName) - { - this.formName = formName; - }*/ - - /** * Gets the current page number of a multi-part form. - * Only field validations with a matching page numer + * Only field validations with a matching page number * will be generated that match the current page number. * Only valid when the formName attribute is set. * @@ -197,9 +169,8 @@ /** * Sets the current page number of a multi-part form. - * Only field validations with a matching page numer + * Only field validations with a matching page number * will be generated that match the current page number. - * Only valid when the formName attribute is set. * * @param page the current page number of a multi-part form */ @@ -235,54 +206,6 @@ } /** - * Gets whether or not to generate the static - * JavaScript. If this is set to 'true', which - * is the default, the static JavaScript will be generated. - * - * @return true to generate the static JavaScript. - */ - /*public boolean getStaticJavascript() - { - return this.staticJavascript; - }*/ - - /** - * Sets whether or not to generate the static - * JavaScript. If this is set to 'true', which - * is the default, the static JavaScript will be generated. - * - * @param staticJavascript whether or not to generate the static JavaScript - */ - /*public void setStaticJavascript(boolean staticJavascript) - { - this.staticJavascript = staticJavascript; - }*/ - - /** - * Gets whether or not to generate the dynamic - * JavaScript. If this is set to 'true', which - * is the default, the dynamic JavaScript will be generated. - * - * @return true to generate the dynamic JavaScript - */ - /*public boolean getDynamicJavascript() - { - return this.dynamicJavascript; - }*/ - - /** - * Sets whether or not to generate the dynamic - * JavaScript. If this is set to 'true', which - * is the default, the dynamic JavaScript will be generated. - * - * @param dynamicJavascript whether or not to generate the dynamic JavaScript - */ - /*public void setDynamicJavascript(boolean dynamicJavascript) - { - this.dynamicJavascript = dynamicJavascript; - }*/ - - /** * Gets whether or not to delimit the * JavaScript with html comments. If this is set to 'true', which * is the default, html comments will surround the JavaScript. @@ -701,8 +624,9 @@ protected String getJavascriptBegin(String methods) { StringBuffer sb = new StringBuffer(); - String name = formName.substring(0, 1).toUpperCase() + - formName.substring(1, formName.length()); + String name = formName.replace('/', '_'); // remove any '/' characters + name = name.substring(0, 1).toUpperCase() + + name.substring(1, name.length()); sb.append(getStartElement());
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
