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=9443>.
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=9443

<logic:present> and <logic:notPresent>  with parameter doesn´t work 

           Summary: <logic:present> and <logic:notPresent>  with parameter
                    doesn´t work
           Product: Struts
           Version: 1.0 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


<logic:present> and <logic:notPresent> tags doesn´t work properly to test for  
the collection you are iterating, if it contains null values.

In the Iterate.java code you can find:
        if (iterator.hasNext()) ....pageContext.setAttribute(id, element);

but the Present.java code at the method:
         protected boolean condition(boolean desired) 

asks to see the attribute in the following way:

[*]       String value = pageContext.getRequest().getParameter(parameter);

so <logic:present> and <logic:notPresent> tags will never guess that the 
collection we are iterating over has a next element and therefore the mentioned 
tags will not work.

I tried to change the last sentence  [*] by :

          Objetct value = pageContext.getAttribute(parameter);

and it worked fine.

Neither in the beta release 1.1  will work.

Regards

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to