You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2003/07/08 02:05:11 UTC

cvs commit: jakarta-struts/doc/userGuide struts-html.xml

dgraham     2003/07/07 17:05:11

  Modified:    src/share/org/apache/struts/taglib/html
                        JavascriptValidatorTag.java FormTag.java
               doc/userGuide struts-html.xml
  Log:
  Added scriptLanguage property to the form and javascript tags for PR# 17234.
  This property is ignored in XHTML mode but allows developers to turn off
  the "language" attribute of <script> tags in HTML.
  
  Revision  Changes    Path
  1.31      +33 -7     jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- JavascriptValidatorTag.java	7 Jul 2003 23:46:35 -0000	1.30
  +++ JavascriptValidatorTag.java	8 Jul 2003 00:05:10 -0000	1.31
  @@ -138,6 +138,13 @@
        * the method name of the main JavaScript method that the form calls to perform validations.
        */
       protected String methodName = null;
  +    
  +    /**
  +     * Include language attribute in the &lt;script&gt; element.  This property is 
  +     * ignored in XHTML mode.
  +     * @since Struts 1.2
  +     */
  +    protected boolean scriptLanguage = true;
   
       /**
        * The static JavaScript methods will only be printed if this is set to "true".
  @@ -690,13 +697,13 @@
       }
   
       /**
  -     * Constructs the beginning &lt;script&gt; element depending on xhtml status.
  +     * Constructs the beginning &lt;script&gt; element depending on XHTML status.
        */
       private String getStartElement() {
           StringBuffer start = new StringBuffer("<script type=\"text/javascript\"");
   
  -        // there is no language attribute in xhtml
  -        if (!this.isXhtml()) {
  +        // there is no language attribute in XHTML
  +        if (!this.isXhtml() && this.scriptLanguage) {
               start.append(" language=\"Javascript1.1\"");
           }
   
  @@ -729,6 +736,25 @@
        */
       public void setCdata(String cdata) {
           this.cdata = cdata;
  +    }
  +
  +    /**
  +     * Gets whether or not the &lt;script&gt; element will include the 
  +     * language attribute.
  +     * @return true if language attribute will be included.
  +     * @since Struts 1.2
  +     */
  +    public boolean getScriptLanguage() {
  +        return this.scriptLanguage;
  +    }
  +
  +    /**
  +     * Sets whether or not the &lt;script&gt; element will include the 
  +     * language attribute.
  +     * @since Struts 1.2
  +     */
  +    public void setScriptLanguage(boolean scriptLanguage) {
  +        this.scriptLanguage = scriptLanguage;
       }
   
   }
  
  
  
  1.50      +31 -5     jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
  
  Index: FormTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- FormTag.java	3 Jul 2003 02:46:59 -0000	1.49
  +++ FormTag.java	8 Jul 2003 00:05:10 -0000	1.50
  @@ -165,6 +165,13 @@
        * is stored.
        */
       protected String scope = null;
  +    
  +    /**
  +     * Include language attribute in the focus script's &lt;script&gt; element.  This
  +     * property is ignored in XHTML mode.
  +     * @since Struts 1.2
  +     */
  +    protected boolean scriptLanguage = true;
   
       /**
        * The ActionServlet instance we are associated with (so that we can
  @@ -699,7 +706,7 @@
   
           results.append(lineEnd);
           results.append("<script type=\"text/javascript\"");
  -        if (!this.isXhtml()) {
  +        if (!this.isXhtml() && this.scriptLanguage) {
               results.append(" language=\"JavaScript\"");
           }
           results.append(">");
  @@ -861,6 +868,25 @@
        */
       public void setFocusIndex(String focusIndex) {
           this.focusIndex = focusIndex;
  +    }
  +
  +    /**
  +     * Gets whether or not the focus script's &lt;script&gt; element will include the 
  +     * language attribute.
  +     * @return true if language attribute will be included.
  +     * @since Struts 1.2
  +     */
  +    public boolean getScriptLanguage() {
  +        return this.scriptLanguage;
  +    }
  +
  +    /**
  +     * Sets whether or not the focus script's &lt;script&gt; element will include the 
  +     * language attribute.
  +     * @since Struts 1.2
  +     */
  +    public void setScriptLanguage(boolean scriptLanguage) {
  +        this.scriptLanguage = scriptLanguage;
       }
   
   }
  
  
  
  1.55      +26 -1     jakarta-struts/doc/userGuide/struts-html.xml
  
  Index: struts-html.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- struts-html.xml	18 Mar 2003 10:50:29 -0000	1.54
  +++ struts-html.xml	8 Jul 2003 00:05:10 -0000	1.55
  @@ -1522,7 +1522,19 @@
                   <code>ActionMapping</code>.
               </deprecated>
           </attribute>
  -
  +        
  +		<attribute>
  +            <name>scriptLanguage</name>
  +            <required>false</required>
  +            <rtexprvalue>true</rtexprvalue>
  +            <info>
  +                The form's focus &lt;script&gt; element will not contain a language attribute
  +                when this is set to false.  The default is true but this property is ignored
  +                in XHMTL mode.
  +            </info>
  +            <since>Struts 1.2</since>
  +        </attribute>
  +        
           <attribute>
               <name>style</name>
               <required>false</required>
  @@ -3316,6 +3328,19 @@
                  </p>
               </info>
           </attribute>
  +        
  +        <attribute>
  +            <name>scriptLanguage</name>
  +            <required>false</required>
  +            <rtexprvalue>true</rtexprvalue>
  +            <info>
  +                The &lt;script&gt; element will not contain a language attribute
  +                when this is set to false.  The default is true but this property is ignored
  +                in XHMTL mode.
  +            </info>
  +            <since>Struts 1.2</since>
  +        </attribute>
  +        
           <attribute>
               <name>src</name>
               <required>false</required>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org