[MAGNOLIA-616] src/main/info/magnolia/cms/taglibs/SetNode.java Does not implement a proper map for JSP page Created: 11/Jan/06  Updated: 20/Feb/15  Resolved: 11/May/06

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 2.1.3
Fix Version/s: 3.0 RC1

Type: Bug Priority: Major
Reporter: Ramon Buckland Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

BEA Weblogic 9


Attachments: Text File SetNode.java    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 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)



 Comments   
Comment by Ramon Buckland [ 11/Jan/06 ]

This implementation uses an external Map implementation
(which is fully implemented).

Comment by Fabrizio Giustina [ 11/May/06 ]

fixed for 3.0 rc1, please test it on weblogic

Generated at Mon Feb 12 03:19:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.