Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-616

src/main/info/magnolia/cms/taglibs/SetNode.java Does not implement a proper map for JSP page

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0 RC1
    • 2.1.3
    • taglibs
    • None
    • BEA Weblogic 9

    Description

      The SetNode Taglib provides a Map of the node data as a JSP page attribute when it is called.
      The way it does this is by "wrapping" a ContentNode in an inner Map implementation

      public static class NodeMapWrapper implements Map {

      It is suspected that the implementation of the map is done because the map is needed to be
      read-only on the JSP page.

      As part of this quassi implementation of a Map, some of the methods are not implemented.
      One of the methods that is not implemented is

      /**

      • @see java.util.Map#entrySet()
        */
        public Set entrySet() { // not implemented, only get() is needed return null; }

      However, Weblogic 9, when a Map is "accessed" in the JSP page, it uses the entrySet method to see if the variable
      requested is actually there.

      ${mymap.somevar}

      in Tomcat relates to a call of

      mymap.get("somevar")

      however Weblogic 9, appears to do something like

      Set set = mymap.entrySet()
      // and derives the value from the Set.

      But because a null object in the impl is returned, the value is then not accessible.

      Solution:
      Assumption : Because the Map provided to the JSP page is to be readonly,
      instead of "implementing a map".

      Our fix was to return an Unmodifiable map (Jak commons) (and not have an internal implementation of a Map)

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              fgiust Fabrizio Giustina
              rbuckland Ramon Buckland
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD