struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10705] New: - Title being created on a link tag when title is not an attribute, but...
Date Thu, 11 Jul 2002 17:26:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10705>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10705

Title being created on a link tag when title is not an attribute, but...

           Summary: Title being created on a link tag when title is not an
                    attribute, but...
           Product: Struts
           Version: 1.0 Beta 2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: bdeluca@intranet.com


the messages-resources parameter "null" is set to "false"

In a link tag, when there is no TITLE attribute set custom tag still adds a 
title when the message-resources in the struts-config has the null parameter 
set to "false"  
Ex:
  <message-resources
    parameter="org.apache.struts.webapp.example.ApplicationResources" 
    null="false"/>

The problem appears to be in the BaseHandlerTag.prepareStyles():

Code snipplet

        value = message(title, titleKey); 
       // When set to False will return ???foo ????
        if (value != null) {   //This will now eval to TRUE.
            styles.append(" title=\"");
            styles.append(value);
            styles.append("\"");
        }

Proposed solution:
In BaseHandlerTag, add a check.
if ( literal == null && key == null )
   return null;

--> If both are null then must want null.  

May want to handle outside of call, perform check before call to message in 
prepareStyles().

if ( title != null || titleKey != null ) {
   value = message( title, titleKey );
   if ( value != null ) {
       // do appending here
   }
}

The first solution will fix problem for both title and alt.  Second solution 
will require adding the logic in front of the alt section as well.

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


Mime
View raw message