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

(-)runtime/JspContextWrapper.java (-16 / +30 lines)
Lines 76-86 Link Here
76
    private Map<String,String> aliases;
76
    private Map<String,String> aliases;
77
77
78
    private HashMap<String, Object> originalNestedVars;
78
    private HashMap<String, Object> originalNestedVars;
79
    
80
    private ServletContext servletContext;
81
    
82
    private ELContext elContext;
83
    
84
    private PageContext rootJspCtxt;
79
85
80
    public JspContextWrapper(JspContext jspContext,
86
    public JspContextWrapper(JspContext jspContext,
81
            ArrayList<String> nestedVars, ArrayList<String> atBeginVars,
87
            ArrayList<String> nestedVars, ArrayList<String> atBeginVars,
82
            ArrayList<String> atEndVars, Map<String,String> aliases) {
88
            ArrayList<String> atEndVars, Map<String,String> aliases) {
83
        this.invokingJspCtxt = (PageContext) jspContext;
89
        this.invokingJspCtxt = (PageContext) jspContext;
90
        if (jspContext instanceof JspContextWrapper) {
91
        	rootJspCtxt = ((JspContextWrapper)jspContext).rootJspCtxt;
92
        }
93
        else {
94
        	rootJspCtxt = invokingJspCtxt;
95
        }
96
        this.servletContext = rootJspCtxt.getServletContext();
97
        this.elContext = rootJspCtxt.getELContext();
84
        this.nestedVars = nestedVars;
98
        this.nestedVars = nestedVars;
85
        this.atBeginVars = atBeginVars;
99
        this.atBeginVars = atBeginVars;
86
        this.atEndVars = atEndVars;
100
        this.atEndVars = atEndVars;
Lines 123-129 Link Here
123
            return pageAttributes.get(name);
137
            return pageAttributes.get(name);
124
        }
138
        }
125
139
126
        return invokingJspCtxt.getAttribute(name, scope);
140
        return rootJspCtxt.getAttribute(name, scope);
127
    }
141
    }
128
142
129
    @Override
143
    @Override
Lines 156-162 Link Here
156
                removeAttribute(name, PAGE_SCOPE);
170
                removeAttribute(name, PAGE_SCOPE);
157
            }
171
            }
158
        } else {
172
        } else {
159
            invokingJspCtxt.setAttribute(name, value, scope);
173
            rootJspCtxt.setAttribute(name, value, scope);
160
        }
174
        }
161
    }
175
    }
162
176
Lines 170-182 Link Here
170
184
171
        Object o = pageAttributes.get(name);
185
        Object o = pageAttributes.get(name);
172
        if (o == null) {
186
        if (o == null) {
173
            o = invokingJspCtxt.getAttribute(name, REQUEST_SCOPE);
187
            o = rootJspCtxt.getAttribute(name, REQUEST_SCOPE);
174
            if (o == null) {
188
            if (o == null) {
175
                if (getSession() != null) {
189
                if (getSession() != null) {
176
                    o = invokingJspCtxt.getAttribute(name, SESSION_SCOPE);
190
                    o = rootJspCtxt.getAttribute(name, SESSION_SCOPE);
177
                }
191
                }
178
                if (o == null) {
192
                if (o == null) {
179
                    o = invokingJspCtxt.getAttribute(name, APPLICATION_SCOPE);
193
                    o = rootJspCtxt.getAttribute(name, APPLICATION_SCOPE);
180
                }
194
                }
181
            }
195
            }
182
        }
196
        }
Lines 193-203 Link Here
193
        }
207
        }
194
208
195
        pageAttributes.remove(name);
209
        pageAttributes.remove(name);
196
        invokingJspCtxt.removeAttribute(name, REQUEST_SCOPE);
210
        rootJspCtxt.removeAttribute(name, REQUEST_SCOPE);
197
        if (getSession() != null) {
211
        if (getSession() != null) {
198
            invokingJspCtxt.removeAttribute(name, SESSION_SCOPE);
212
        	rootJspCtxt.removeAttribute(name, SESSION_SCOPE);
199
        }
213
        }
200
        invokingJspCtxt.removeAttribute(name, APPLICATION_SCOPE);
214
        rootJspCtxt.removeAttribute(name, APPLICATION_SCOPE);
201
    }
215
    }
202
216
203
    @Override
217
    @Override
Lines 211-217 Link Here
211
        if (scope == PAGE_SCOPE) {
225
        if (scope == PAGE_SCOPE) {
212
            pageAttributes.remove(name);
226
            pageAttributes.remove(name);
213
        } else {
227
        } else {
214
            invokingJspCtxt.removeAttribute(name, scope);
228
        	rootJspCtxt.removeAttribute(name, scope);
215
        }
229
        }
216
    }
230
    }
217
231
Lines 226-232 Link Here
226
        if (pageAttributes.get(name) != null) {
240
        if (pageAttributes.get(name) != null) {
227
            return PAGE_SCOPE;
241
            return PAGE_SCOPE;
228
        } else {
242
        } else {
229
            return invokingJspCtxt.getAttributesScope(name);
243
            return rootJspCtxt.getAttributesScope(name);
230
        }
244
        }
231
    }
245
    }
232
246
Lines 236-242 Link Here
236
            return Collections.enumeration(pageAttributes.keySet());
250
            return Collections.enumeration(pageAttributes.keySet());
237
        }
251
        }
238
252
239
        return invokingJspCtxt.getAttributeNamesInScope(scope);
253
        return rootJspCtxt.getAttributeNamesInScope(scope);
240
    }
254
    }
241
255
242
    @Override
256
    @Override
Lines 246-257 Link Here
246
260
247
    @Override
261
    @Override
248
    public JspWriter getOut() {
262
    public JspWriter getOut() {
249
        return invokingJspCtxt.getOut();
263
        return rootJspCtxt.getOut();
250
    }
264
    }
251
265
252
    @Override
266
    @Override
253
    public HttpSession getSession() {
267
    public HttpSession getSession() {
254
        return invokingJspCtxt.getSession();
268
        return rootJspCtxt.getSession();
255
    }
269
    }
256
270
257
    @Override
271
    @Override
Lines 266-272 Link Here
266
280
267
    @Override
281
    @Override
268
    public ServletResponse getResponse() {
282
    public ServletResponse getResponse() {
269
        return invokingJspCtxt.getResponse();
283
        return rootJspCtxt.getResponse();
270
    }
284
    }
271
285
272
    @Override
286
    @Override
Lines 281-287 Link Here
281
295
282
    @Override
296
    @Override
283
    public ServletContext getServletContext() {
297
    public ServletContext getServletContext() {
284
        return invokingJspCtxt.getServletContext();
298
        return servletContext;
285
    }
299
    }
286
300
287
    @Override
301
    @Override
Lines 481-487 Link Here
481
    public ELContext getELContext() {
495
    public ELContext getELContext() {
482
        // instead decorate!!!
496
        // instead decorate!!!
483
        
497
        
484
        return this.invokingJspCtxt.getELContext();
498
        return elContext;
485
        
499
        
486
        /*
500
        /*
487
        if (this.elContext != null) {
501
        if (this.elContext != null) {

Return to bug 53869