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

(-)java/org/apache/jasper/runtime/JspContextWrapper.java (-6 / +28 lines)
Lines 377-385 Link Here
377
			Object obj = getAttribute(varName);
377
			Object obj = getAttribute(varName);
378
			varName = findAlias(varName);
378
			varName = findAlias(varName);
379
			if (obj != null) {
379
			if (obj != null) {
380
				invokingJspCtxt.setAttribute(varName, obj);
380
			    getOuterInvokingJspCtxt().setAttribute(varName, obj);
381
			} else {
381
			} else {
382
				invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE);
382
			    getOuterInvokingJspCtxt().removeAttribute(varName, PAGE_SCOPE);
383
			}
383
			}
384
		}
384
		}
385
	}
385
	}
Lines 394-400 Link Here
394
			while (iter.hasNext()) {
394
			while (iter.hasNext()) {
395
				String varName = iter.next();
395
				String varName = iter.next();
396
				varName = findAlias(varName);
396
				varName = findAlias(varName);
397
				Object obj = invokingJspCtxt.getAttribute(varName);
397
				Object obj = getOuterInvokingJspCtxt().getAttribute(varName);
398
				if (obj != null) {
398
				if (obj != null) {
399
					originalNestedVars.put(varName, obj);
399
					originalNestedVars.put(varName, obj);
400
				}
400
				}
Lines 413-427 Link Here
413
				varName = findAlias(varName);
413
				varName = findAlias(varName);
414
				Object obj = originalNestedVars.get(varName);
414
				Object obj = originalNestedVars.get(varName);
415
				if (obj != null) {
415
				if (obj != null) {
416
					invokingJspCtxt.setAttribute(varName, obj);
416
				    getOuterInvokingJspCtxt().setAttribute(varName, obj);
417
				} else {
417
				} else {
418
					invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE);
418
				    getOuterInvokingJspCtxt().removeAttribute(
419
				            varName, PAGE_SCOPE);
419
				}
420
				}
420
			}
421
			}
421
		}
422
		}
422
	}
423
	}
423
424
424
	/**
425
    /**
426
     * Obtain the page context for the invoking tag/page.
427
     * 
428
     * @return The page context for the invoking tag/page
429
     */
430
    protected PageContext getInvokingJspCtxt() {
431
        return invokingJspCtxt;
432
    }
433
434
    /**
435
     * Obtain the page context for the invoking JSP page. Where iterative tags
436
     * are in use this will eb idfferent to {@link #getInvokingJspCtxt()}.
437
     */
438
    private PageContext getOuterInvokingJspCtxt() {
439
        PageContext pc = invokingJspCtxt;
440
        while (pc instanceof JspContextWrapper) {
441
            pc = ((JspContextWrapper) pc).getInvokingJspCtxt();
442
        }
443
        return pc;
444
    }
445
446
    /**
425
	 * Checks to see if the given variable name is used as an alias, and if so,
447
	 * Checks to see if the given variable name is used as an alias, and if so,
426
	 * returns the variable name for which it is used as an alias.
448
	 * returns the variable name for which it is used as an alias.
427
	 * 
449
	 * 

Return to bug 46339