View | Details | Raw Unified | Return to bug 49547
Collapse All | Expand All

(-)src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (+3 lines)
Lines 62-67 Link Here
62
    @Test
62
    @Test
63
    public void test49526WhenNotMapped() throws JspException {
63
    public void test49526WhenNotMapped() throws JspException {
64
        tag.setVar(VAR);
64
        tag.setVar(VAR);
65
        tag.valueSpecified = true;
65
        tag.value = VALUE;
66
        tag.value = VALUE;
66
67
67
        // verify mapper is checked but that no action is taken
68
        // verify mapper is checked but that no action is taken
Lines 80-85 Link Here
80
    @Test
81
    @Test
81
    public void test49526WhenAlreadyMapped() throws JspException {
82
    public void test49526WhenAlreadyMapped() throws JspException {
82
        tag.setVar(VAR);
83
        tag.setVar(VAR);
84
        tag.valueSpecified = true;
83
        tag.value = VALUE;
85
        tag.value = VALUE;
84
86
85
        // verify mapper is checked and the mapped variable removed
87
        // verify mapper is checked and the mapped variable removed
Lines 100-105 Link Here
100
    @Test
102
    @Test
101
    public void test49526WhenNotUsingPageContext() throws JspException {
103
    public void test49526WhenNotUsingPageContext() throws JspException {
102
        tag.setVar(VAR);
104
        tag.setVar(VAR);
105
        tag.valueSpecified = true;
103
        tag.value = VALUE;
106
        tag.value = VALUE;
104
        tag.setScope("request");
107
        tag.setScope("request");
105
108
(-)src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (-16 / +10 lines)
Lines 183-206 Link Here
183
    }
183
    }
184
    
184
    
185
    Object getResult() {
185
    Object getResult() {
186
        Object result;      // what we'll store in scope:var
186
        if (valueSpecified) {
187
187
            return value;
188
        // determine the value by...
188
        } else if (bodyContent == null) {
189
        if (value != null) {
189
            return "";
190
            // ... reading our attribute
191
            result = value;
192
        } else if (valueSpecified) {
193
            // ... accepting an explicit null
194
            result = null;
195
        } else {
190
        } else {
196
            // ... retrieving and trimming our body
191
            String content = bodyContent.getString();
197
            if (bodyContent == null || bodyContent.getString() == null)
192
            if (content == null) {
198
                result = "";
193
                return "";
199
            else
194
            } else {
200
                result = bodyContent.getString().trim();
195
                return content.trim();
196
            }
201
        }
197
        }
202
203
        return result;
204
    }
198
    }
205
    
199
    
206
    /**
200
    /**

Return to bug 49547