You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2002/01/13 04:38:38 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html BaseHandlerTag.java ImageTag.java ImgTag.java LocalStrings.properties

craigmcc    02/01/12 19:38:38

  Modified:    doc      struts-html.xml
               src/share/org/apache/struts/taglib/html BaseHandlerTag.java
                        ImageTag.java ImgTag.java LocalStrings.properties
  Log:
  Refactor the HTML tag library classes so that the "alt", "altKey", "title",
  and "titleKey" (new) attributes are all implemented in the
  BaseHandlerTag class, and modify the TLD so that they are valid wherever
  the HTML "alt" and "title" attributes are allowed, respectively.
  
  Based on patches submitted by B. Vandrift <ka...@evilbastard.com>
  
  Revision  Changes    Path
  1.30      +581 -23   jakarta-struts/doc/struts-html.xml
  
  Index: struts-html.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/doc/struts-html.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- struts-html.xml	13 Jan 2002 00:25:35 -0000	1.29
  +++ struts-html.xml	13 Jan 2002 03:38:38 -0000	1.30
  @@ -89,6 +89,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -288,6 +307,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -327,6 +365,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -519,6 +576,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -572,6 +648,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -782,6 +877,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -920,6 +1034,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -1148,6 +1281,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -1327,6 +1479,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>type</name>
               <required>false</required>
  @@ -1362,6 +1533,25 @@
           </info>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
               <name>indexed</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  @@ -1396,6 +1586,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -1490,7 +1699,7 @@
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                   <info>
  -                <p>The alternate text for this image.</p>
  +                <p>The alternate text for this element.</p>
                   </info>
           </attribute>
   
  @@ -1500,7 +1709,7 @@
                   <rtexprvalue>true</rtexprvalue>
                   <info>
                   <p>The message resources key of the alternate text for this
  -                image.</p>
  +                element.</p>
                   </info>
           </attribute>
   
  @@ -1707,6 +1916,25 @@
               <rtexprvalue>true</rtexprvalue>
             </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
             <attribute>
               <name>value</name>
               <required>false</required>
  @@ -1839,27 +2067,24 @@
                     </info>
                   </attribute>
   
  -                <attribute>
  -                  <name>alt</name>
  -                  <required>false</required>
  -                  <rtexprvalue>true</rtexprvalue>
  -                  <info>
  -                  <p>And alternative text to be displayed in browsers that
  -                     don't support graphics.  Also used often as type of
  -                     context help over images.</p>
  -                  </info>
  -                </attribute>
  +        <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
   
  -                <attribute>
  -                  <name>altKey</name>
  -                  <required>false</required>
  -                  <rtexprvalue>true</rtexprvalue>
  -                  <info>
  -                  <p>The message key, in the message resources bundle named by
  -                  the <code>bundle</code> attribute, of the String to be
  -                  displayed as the alternate text for this image.</p>
  -                  </info>
  -                </attribute>
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
   
                   <attribute>
                     <name>border</name>
  @@ -2147,6 +2372,25 @@
           </attribute>
   
                   <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
                     <name>usemap</name>
                     <required>false</required>
                     <rtexprvalue>true</rtexprvalue>
  @@ -2638,7 +2882,17 @@
                     <required>false</required>
                     <rtexprvalue>true</rtexprvalue>
                     <info>
  -                  <p>The advisory title for this hyperlink.</p>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
                     </info>
                   </attribute>
   
  @@ -2817,6 +3071,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -3015,6 +3288,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -3307,6 +3599,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -3562,6 +3873,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -3600,6 +3930,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -3770,6 +4119,25 @@
           </attribute>
   
                   <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
                           <name>value</name>
                           <required>true</required>
                           <rtexprvalue>true</rtexprvalue>
  @@ -3804,6 +4172,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -3981,6 +4368,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -4221,6 +4627,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -4452,6 +4877,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -4485,6 +4929,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -4684,6 +5147,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -4716,6 +5198,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
             <name>disabled</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
  @@ -4954,6 +5455,25 @@
               </info>
           </attribute>
   
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
  +
           <attribute>
               <name>value</name>
               <required>false</required>
  @@ -4989,6 +5509,25 @@
           </attribute>
   
           <attribute>
  +                <name>alt</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The alternate text for this element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
  +                <name>altKey</name>
  +                <required>false</required>
  +                <rtexprvalue>true</rtexprvalue>
  +                <info>
  +                <p>The message resources key of the alternate text for this
  +                element.</p>
  +                </info>
  +        </attribute>
  +
  +        <attribute>
               <name>cols</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  @@ -5226,6 +5765,25 @@
                   The tab order (ascending positive integers) for this element.
               </info>
           </attribute>
  +
  +                <attribute>
  +                  <name>title</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The advisory title for this element.</p>
  +                  </info>
  +                </attribute>
  +
  +                <attribute>
  +                  <name>titleKey</name>
  +                  <required>false</required>
  +                  <rtexprvalue>true</rtexprvalue>
  +                  <info>
  +                  <p>The message resources key for the advisory title
  +                  for this element.</p>
  +                  </info>
  +                </attribute>
   
           <attribute>
               <name>value</name>
  
  
  
  1.13      +126 -11   jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java
  
  Index: BaseHandlerTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- BaseHandlerTag.java	11 Dec 2001 17:54:28 -0000	1.12
  +++ BaseHandlerTag.java	13 Jan 2002 03:38:38 -0000	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java,v 1.12 2001/12/11 17:54:28 oalexeev Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/12/11 17:54:28 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java,v 1.13 2002/01/13 03:38:38 craigmcc Exp $
  + * $Revision: 1.13 $
  + * $Date: 2002/01/13 03:38:38 $
    *
    * ====================================================================
    *
  @@ -61,8 +61,11 @@
   
   package org.apache.struts.taglib.html;
   
  +import java.util.Locale;
   import javax.servlet.jsp.JspException;
  +import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.BodyTagSupport;
  +import org.apache.struts.action.Action;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.taglib.logic.IterateTag;
  @@ -74,7 +77,7 @@
    * appropriate implementations of these.
    *
    * @author Don Clasen
  - * @version $Revision: 1.12 $ $Date: 2001/12/11 17:54:28 $
  + * @version $Revision: 1.13 $ $Date: 2002/01/13 03:38:38 $
    */
   
   public abstract class BaseHandlerTag extends BodyTagSupport {
  @@ -84,6 +87,12 @@
   
   
       /**
  +     * The default Locale for our server.
  +     */
  +    protected static final Locale defaultLocale = Locale.getDefault();
  +
  +
  +    /**
        * The message resources for this package.
        */
       protected static MessageResources messages =
  @@ -172,9 +181,24 @@
   
   // Other Common Attributes
   
  +    /** The alternate text of this element. */
  +    private String alt = null;
  +
  +    /** The message resources key of the alternate text. */
  +    private String altKey = null;
  +
  +    /** The name of the message resources bundle for message lookups. */
  +    private String bundle = null;
  +
  +    /** The name of the session attribute key for our locale. */
  +    private String locale = Action.LOCALE_KEY;
  +
       /** The advisory title of this element. */
       private String title = null;
   
  +    /** The message resources key of the advisory title. */
  +    private String titleKey = null;
  +
   
       // ------------------------------------------------------------- Properties
   
  @@ -415,6 +439,46 @@
   
   // Other Common Elements
   
  +    /** Returns the alternate text attribute. */
  +    public String getAlt() {
  +        return alt;
  +    }
  +
  +    /** Sets the alternate text attribute. */
  +    public void setAlt(String alt) {
  +        this.alt = alt;
  +    }
  +
  +    /** Returns the message resources key of the alternate text. */
  +    public String getAltKey() {
  +        return altKey;
  +    }
  +
  +    /** Sets the message resources key of the alternate text. */
  +    public void setAltKey(String altKey) {
  +        this.altKey = altKey;
  +    }
  +
  +    /** Returns the name of the message resources bundle to use. */
  +    public String getBundle() {
  +        return bundle;
  +    }
  +
  +    /** Sets the name of the message resources bundle to use. */
  +    public void setBundle(String bundle) {
  +        this.bundle = bundle;
  +    }
  +
  +    /** Returns the name of the session attribute for our locale. */
  +    public String getLocale() {
  +        return locale;
  +    }
  +
  +    /** Sets the name of the session attribute for our locale. */
  +    public void setLocale(String locale) {
  +        this.locale = locale;
  +    }
  +
       /** Returns the advisory title attribute. */
       public String getTitle() {
           return title;
  @@ -425,6 +489,16 @@
           this.title = title;
       }
   
  +    /** Returns the message resources key of the advisory title. */
  +    public String getTitleKey() {
  +        return titleKey;
  +    }
  +
  +    /** Sets the message resources key of the advisory title. */
  +    public void setTitleKey(String titleKey) {
  +        this.titleKey = titleKey;
  +    }
  +
   
       // --------------------------------------------------------- Public Methods
   
  @@ -436,7 +510,11 @@
   
           super.release();
           accesskey = null;
  -        tabindex = null;
  +        alt = null;
  +        altKey = null;
  +        bundle = null;
  +        indexed = false;
  +        locale = Action.LOCALE_KEY;
           onclick = null;
           ondblclick = null;
           onmouseover = null;
  @@ -456,14 +534,44 @@
           style = null;
           styleClass = null;
           styleId = null;
  +        tabindex = null;
           title = null;
  -        indexed = false;
  +        titleKey = null;
   
       }
   
   
       // ------------------------------------------------------ Protected Methods
   
  +
  +    /**
  +     * Return the text specified by the literal value or the message resources
  +     * key, if any; otherwise return <code>null</code>.
  +     *
  +     * @param literal Literal text value or <code>null</code>
  +     * @param key Message resources key or <code>null</code>
  +     *
  +     * @exception JspException if both arguments are non-null
  +     */
  +    protected String message(String literal, String key) throws JspException {
  +
  +        if (literal != null) {
  +            if (key != null) {
  +                JspException e = new JspException
  +                    (messages.getMessage("common.both"));
  +                RequestUtils.saveException(pageContext, e);
  +                throw e;
  +            } else {
  +                return (literal);
  +            }
  +        } else {
  +            return (RequestUtils.message(pageContext, getBundle(),
  +                                         getLocale(), key));
  +        }
  +
  +    }
  +
  +
       /**
        *  Appends bean name with index in brackets for tags with
        *  'true' value in 'indexed' attribute.
  @@ -492,8 +600,10 @@
       /**
        * Prepares the style attributes for inclusion in the component's HTML tag.
        * @return The prepared String for inclusion in the HTML tag.
  +     * @exception JspException if invalid attributes are specified
        */
  -    protected String prepareStyles() {
  +    protected String prepareStyles() throws JspException {
  +        String value = null;
           StringBuffer styles = new StringBuffer();
           if (style != null) {
               styles.append(" style=\"");
  @@ -510,9 +620,16 @@
               styles.append(getStyleId());
               styles.append("\"");
           }
  -        if (title != null) {
  +        value = message(title, titleKey);
  +        if (value != null) {
               styles.append(" title=\"");
  -            styles.append(getTitle());
  +            styles.append(value);
  +            styles.append("\"");
  +        }
  +        value = message(alt, altKey);
  +        if (value != null) {
  +            styles.append(" alt=\"");
  +            styles.append(value);
               styles.append("\"");
           }
           return styles.toString();
  @@ -655,8 +772,6 @@
           }
   
       }
  -
  -
   
   
   }
  
  
  
  1.15      +10 -130   jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java
  
  Index: ImageTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ImageTag.java	13 Jan 2002 00:25:37 -0000	1.14
  +++ ImageTag.java	13 Jan 2002 03:38:38 -0000	1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v 1.14 2002/01/13 00:25:37 craigmcc Exp $
  - * $Revision: 1.14 $
  - * $Date: 2002/01/13 00:25:37 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v 1.15 2002/01/13 03:38:38 craigmcc Exp $
  + * $Revision: 1.15 $
  + * $Date: 2002/01/13 03:38:38 $
    *
    * ====================================================================
    *
  @@ -65,7 +65,6 @@
   
   import java.lang.reflect.Method;
   import java.io.IOException;
  -import java.util.Locale;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.jsp.JspException;
  @@ -82,21 +81,12 @@
    * Tag for input fields of type "image".
    *
    * @author Oleg V Alexeev
  - * @version $Revision: 1.14 $ $Date: 2002/01/13 00:25:37 $
  + * @version $Revision: 1.15 $ $Date: 2002/01/13 03:38:38 $
    */
   
   public class ImageTag extends SubmitTag {
   
   
  -    // ----------------------------------------------------- Instance Variables
  -
  -
  -    /**
  -     * The default Locale for our server.
  -     */
  -    protected static final Locale defaultLocale = Locale.getDefault();
  -
  -
       // ------------------------------------------------------------- Properties
   
       
  @@ -115,34 +105,6 @@
   
   
       /**
  -     * The alternate text for this image.
  -     */
  -    protected String alt = null;
  -
  -    public String getAlt() {
  -        return (this.alt);
  -    }
  -
  -    public void setAlt(String alt) {
  -        this.alt = alt;
  -    }
  -
  -
  -    /**
  -     * The message resources key for the alternate text for this image.
  -     */
  -    protected String altKey = null;
  -
  -    public String getAltKey() {
  -        return (this.altKey);
  -    }
  -
  -    public void setAltKey(String altKey) {
  -        this.altKey = altKey;
  -    }
  -
  -
  -    /**
        * The border size around the image.
        */
       protected String border = null;
  @@ -157,34 +119,6 @@
   
   
       /**
  -     * The servlet context attribute key for our resources.
  -     */
  -    protected String bundle = Action.MESSAGES_KEY;
  -
  -    public String getBundle() {
  -        return (this.bundle);
  -    }
  -
  -    public void setBundle(String bundle) {
  -        this.bundle = bundle;
  -    }
  -
  -
  -    /**
  -     * The session attribute key for our locale.
  -     */
  -    protected String locale = Action.LOCALE_KEY;
  -
  -    public String getLocale() {
  -        return (this.locale);
  -    }
  -
  -    public void setLocale(String locale) {
  -        this.locale = locale;
  -    }
  -
  -
  -    /**
        * The application-relative URI of the image.
        */
       protected String page = null;
  @@ -295,12 +229,6 @@
               results.append(response.encodeURL(tmp));
               results.append("\"");
           }
  -        tmp = alt();
  -        if (tmp != null) {
  -            results.append(" alt=\"");
  -            results.append(tmp);
  -            results.append("\"");
  -        }
           if (align != null) {
               results.append(" align=\"");
               results.append(align);
  @@ -345,10 +273,6 @@
       public void release() {
   
           super.release();
  -        alt = null;
  -        altKey = null;
  -        bundle = Action.MESSAGES_KEY;
  -        locale = Action.LOCALE_KEY;
           page = null;
           pageKey = null;
           property = "";
  @@ -362,50 +286,6 @@
   
   
       /**
  -     * Return the alternate text to be included on this generated element,
  -     * or <code>null</code> if there is no such text.
  -     *
  -     * @exception JspException if an error occurs
  -     */
  -    protected String alt() throws JspException {
  -
  -        if (this.alt != null) {
  -            if (this.altKey != null) {
  -                JspException e = new JspException
  -                    (messages.getMessage("imgTag.alt"));
  -                RequestUtils.saveException(pageContext, e);
  -                throw e;
  -            } else {
  -                return (this.alt);
  -            }
  -        } else if (this.altKey != null) {
  -            MessageResources resources = (MessageResources)
  -                pageContext.getAttribute(this.bundle,
  -                                         PageContext.APPLICATION_SCOPE);
  -            if (resources == null) {
  -                JspException e = new JspException
  -                    (messages.getMessage("imgTag.bundle", this.bundle));
  -                throw e;
  -            }
  -            Locale locale = null;
  -            try {
  -                locale = (Locale)
  -                    pageContext.getAttribute(this.locale,
  -                                             PageContext.SESSION_SCOPE);
  -            } catch (IllegalStateException e) {
  -                locale = null; // Invalidated session
  -            }
  -            if (locale == null)
  -                locale = defaultLocale;
  -            return (resources.getMessage(locale, this.altKey));
  -        } else {
  -            return (null);
  -        }
  -
  -    }
  -
  -
  -    /**
        * Return the base source URL that will be rendered in the <code>src</code>
        * property for this generated element, or <code>null</code> if there is
        * no such URL.
  @@ -449,12 +329,12 @@
                   (HttpServletRequest) pageContext.getRequest();
               if (config == null) {
                   return (request.getContextPath() +
  -                        RequestUtils.message(pageContext, bundle,
  -                                             locale, this.pageKey));
  +                        RequestUtils.message(pageContext, getBundle(),
  +                                             getLocale(), this.pageKey));
               } else {
                   return (request.getContextPath() + config.getPrefix() +
  -                        RequestUtils.message(pageContext, bundle,
  -                                             locale, this.pageKey));
  +                        RequestUtils.message(pageContext, getBundle(),
  +                                             getLocale(), this.pageKey));
               }
           }
   
  @@ -476,8 +356,8 @@
               RequestUtils.saveException(pageContext, e);
               throw e;
           }
  -        return (RequestUtils.message(pageContext, bundle,
  -                                     locale, this.srcKey));
  +        return (RequestUtils.message(pageContext, getBundle(),
  +                                     getLocale(), this.srcKey));
   
       }
   
  
  
  
  1.15      +10 -130   jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java
  
  Index: ImgTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ImgTag.java	13 Jan 2002 00:25:37 -0000	1.14
  +++ ImgTag.java	13 Jan 2002 03:38:38 -0000	1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v 1.14 2002/01/13 00:25:37 craigmcc Exp $
  - * $Revision: 1.14 $
  - * $Date: 2002/01/13 00:25:37 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v 1.15 2002/01/13 03:38:38 craigmcc Exp $
  + * $Revision: 1.15 $
  + * $Date: 2002/01/13 03:38:38 $
    *
    * ====================================================================
    *
  @@ -67,7 +67,6 @@
   import java.lang.reflect.InvocationTargetException;
   import java.net.URLEncoder;
   import java.util.Iterator;
  -import java.util.Locale;
   import java.util.Map;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  @@ -96,7 +95,7 @@
    *
    * @author Michael Westbay
    * @author Craig McClanahan
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   
   public class ImgTag extends BaseHandlerTag {
  @@ -120,35 +119,6 @@
   
   
       /**
  -     * The alternate text to display for the image.  This is used for
  -     * text based browsers and/or as a "tool-tip" for the image.
  -     */
  -    protected String alt = null;
  -
  -    public String getAlt() {
  -        return (this.alt);
  -    }
  -
  -    public void setAlt(String alt) {
  -        this.alt = alt;
  -    }
  -
  -
  -    /**
  -     * The message lookup key used to look up internationalized messages.
  -     */
  -    protected String altKey = null;
  -
  -    public String getAltKey() {
  -        return (this.altKey);
  -    }
  -
  -    public void setAltKey(String altKey) {
  -        this.altKey = altKey;
  -    }
  -
  -
  -    /**
        * The border size around the image.
        */
       protected String border = null;
  @@ -163,27 +133,6 @@
   
   
       /**
  -     * The name of the servlet context attribute containing our message
  -     * resources.
  -     */
  -    protected String bundle = Action.MESSAGES_KEY;
  -
  -    public String getBundle() {
  -        return (this.bundle);
  -    }
  -
  -    public void setBundle(String bundle) {
  -        this.bundle = bundle;
  -    }
  -
  -
  -    /**
  -     * The default Locale for our server.
  -     */
  -    protected static final Locale defaultLocale = Locale.getDefault();
  -
  -
  -    /**
        * The image height.
        */
       protected String height = null;
  @@ -240,21 +189,6 @@
   
   
       /**
  -     * The name of the attribute containing the Locale to be used for
  -     * looking up internationalized messages.
  -     */
  -    protected String locale = Action.LOCALE_KEY;
  -
  -    public String getLocale() {
  -        return (this.locale);
  -    }
  -
  -    public void setLocale(String locale) {
  -        this.locale = locale;
  -    }
  -
  -
  -    /**
        * The low resolution image source URI.
        */
       protected String lowsrc = null;
  @@ -518,12 +452,6 @@
               results.append(response.encodeURL(lowsrcurl));
               results.append("\"");
           }
  -        tmp = alt();
  -        if (tmp != null) {
  -            results.append(" alt=\"");
  -            results.append(tmp);
  -            results.append("\"");
  -        }
           if (imageName != null) {
               results.append(" name=\"");
               results.append(imageName);
  @@ -588,15 +516,11 @@
       public void release() {
   
   	super.release();
  -        alt = null;
  -        altKey = null;
           border = null;
  -        bundle = Action.MESSAGES_KEY;
           height = null;
           hspace = null;
           imageName = null;
           ismap = null;
  -        locale = Action.LOCALE_KEY;
           lowsrc = null;
   	name = null;
           page = null;
  @@ -620,50 +544,6 @@
   
   
       /**
  -     * Return the alternate text to be included on this generated element,
  -     * or <code>null</code> if there is no such text.
  -     *
  -     * @exception JspException if an error occurs
  -     */
  -    protected String alt() throws JspException {
  -
  -        if (this.alt != null) {
  -            if (this.altKey != null) {
  -                JspException e = new JspException
  -                    (messages.getMessage("imgTag.alt"));
  -                RequestUtils.saveException(pageContext, e);
  -                throw e;
  -            } else {
  -                return (this.alt);
  -            }
  -        } else if (this.altKey != null) {
  -            MessageResources resources = (MessageResources)
  -                pageContext.getAttribute(this.bundle,
  -                                         PageContext.APPLICATION_SCOPE);
  -            if (resources == null) {
  -                JspException e = new JspException
  -                    (messages.getMessage("imgTag.bundle", this.bundle));
  -                throw e;
  -            }
  -            Locale locale = null;
  -            try {
  -                locale = (Locale)
  -                    pageContext.getAttribute(this.locale,
  -                                             PageContext.SESSION_SCOPE);
  -            } catch (IllegalStateException e) {
  -                locale = null; // Invalidated session
  -            }
  -            if (locale == null)
  -                locale = defaultLocale;
  -            return (resources.getMessage(locale, this.altKey));
  -        } else {
  -            return (null);
  -        }
  -
  -    }
  -
  -
  -    /**
        * Return the base source URL that will be rendered in the <code>src</code>
        * property for this generated element, or <code>null</code> if there is
        * no such URL.
  @@ -707,12 +587,12 @@
                   (HttpServletRequest) pageContext.getRequest();
               if (config == null) {
                   return (request.getContextPath() +
  -                        RequestUtils.message(pageContext, bundle,
  -                                             locale, this.pageKey));
  +                        RequestUtils.message(pageContext, getBundle(),
  +                                             getLocale(), this.pageKey));
               } else {
                   return (request.getContextPath() + config.getPrefix() +
  -                        RequestUtils.message(pageContext, bundle,
  -                                             locale, this.pageKey));
  +                        RequestUtils.message(pageContext, getBundle(),
  +                                             getLocale(), this.pageKey));
               }
           }
   
  @@ -734,8 +614,8 @@
               RequestUtils.saveException(pageContext, e);
               throw e;
           }
  -        return (RequestUtils.message(pageContext, bundle,
  -                                     locale, this.srcKey));
  +        return (RequestUtils.message(pageContext, getBundle(),
  +                                     getLocale(), this.srcKey));
   
       }
   
  
  
  
  1.13      +2 -0      jakarta-struts/src/share/org/apache/struts/taglib/html/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/LocalStrings.properties,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LocalStrings.properties	16 Oct 2001 15:43:58 -0000	1.12
  +++ LocalStrings.properties	13 Jan 2002 03:38:38 -0000	1.13
  @@ -1,3 +1,4 @@
  +common.both=You can specify either the literal value or a message key but not both
   common.io=Encountered input/output error: {0}
   enumerateTag.enumeration=Cannot create enumeration for {0}
   formTag.collections=Cannot find ActionMappings or ActionFormBeans collection
  @@ -17,6 +18,7 @@
   imgTag.alt=You may specify either alt or altKey but not both
   imgTag.bundle=Cannot find message resources bundle under key {0}
   imgTag.src=You must specify exactly one of src, srcKey, page, or pageKey
  +imgTag.title=You may specify either title or titleKey but not both
   imgTag.type=Object must be of type Map
   includeTag.include=Error including page {0}: {1}
   includeTag.lookup=Cannot find global forward named {0}
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>