Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-1678

bean:size and logic:iterate throws JSPException if collection is null

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • Nightly Build
    • None
    • Tag Libraries
    • None
    • Operating System: All
      Platform: All
    • 22382

    Description

      bean:size throws JSPException if tested collection is null. It forces using
      logic:present before.

      Is it not simpler, to return size equal to 0 if tested collection does not exist?

      The same concept could be used for logic:iterate.

      It is generally correct, that contract between JSP and backand is "no bean, no
      result". Such contract saves some memory. But if external library returns
      Colelction you must explicite check if it is empty or not, means overhead for
      any such case.

      Proposed extension simplifies development and secure application against methods
      returning sometimes null and sometimes empty collection.

      Attachments

        Activity

          People

            Unassigned Unassigned
            radzimir@polbox.com Radoslaw Wisniewski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: