Hi All,
I am currently using the struts validator (Struts 1.2.9) to create some 
client side validation code for one of my JSP pages.  The problem I have 
is that some of the JavaScript it creates includes some JavaDoc comments 
such as:

    /*$RCSfile: validateMaxLength.js,v $ $Rev: 376673 $ $Date: 2006-02-10 
13:42:31 +0000 (Fri, 10 Feb 2006) $ */
    /**
    * A field is considered valid if less than the specified maximum.
    * Fields are not checked if they are disabled.
    * <p>
    * <strong>Caution:</strong> Using <code>validateMaxLength</code> on a 
password field in a 
    *  login page gives unnecessary information away to hackers. While it 
only slightly
    *  weakens security, we suggest using it only when modifying a 
password.</p>
    * @param form The form validation is taking place on.
    */
    function validateMaxLength(form) { 


Therefore when I run my generated HTML through the W3C tidy application it 
complains with :

"<" + "/" + letter not allowed here
Cause:

The 2 characters "</" have been detected in a wrong place.
Solution:

In most case, this is due to wrong javascript:

BAD   <document.write("</h1>");
GOOD  <document.write("<\/h1>");

References:

W3C faq: http://validator.w3.org/docs/help.html#faq-javascript
HtmlHelp: http://www.htmlhelp.com/tools/validator/problems.html#script

So, my questions are, is there someway to supress the comments being 
included ?  or how am I supposed to use the Struts validator to generate 
W3C compliant HTML ?

Many thanks for your time

Neil

Reply via email to