ASF Bugzilla – Attachment 23055 Details for
Bug 46339
Recursive tag files with JspFragment attributes fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch used for testing
bug46339.patch (text/plain), 2.20 KB, created by
Mark Thomas
on 2008-12-28 15:16:20 UTC
(
hide
)
Description:
Patch used for testing
Filename:
MIME Type:
Creator:
Mark Thomas
Created:
2008-12-28 15:16:20 UTC
Size:
2.20 KB
patch
obsolete
>Index: java/org/apache/jasper/runtime/JspContextWrapper.java >=================================================================== >--- java/org/apache/jasper/runtime/JspContextWrapper.java (revision 729765) >+++ java/org/apache/jasper/runtime/JspContextWrapper.java (working copy) >@@ -377,9 +377,9 @@ > Object obj = getAttribute(varName); > varName = findAlias(varName); > if (obj != null) { >- invokingJspCtxt.setAttribute(varName, obj); >+ getOuterInvokingJspCtxt().setAttribute(varName, obj); > } else { >- invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE); >+ getOuterInvokingJspCtxt().removeAttribute(varName, PAGE_SCOPE); > } > } > } >@@ -394,7 +394,7 @@ > while (iter.hasNext()) { > String varName = iter.next(); > varName = findAlias(varName); >- Object obj = invokingJspCtxt.getAttribute(varName); >+ Object obj = getOuterInvokingJspCtxt().getAttribute(varName); > if (obj != null) { > originalNestedVars.put(varName, obj); > } >@@ -413,15 +413,37 @@ > varName = findAlias(varName); > Object obj = originalNestedVars.get(varName); > if (obj != null) { >- invokingJspCtxt.setAttribute(varName, obj); >+ getOuterInvokingJspCtxt().setAttribute(varName, obj); > } else { >- invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE); >+ getOuterInvokingJspCtxt().removeAttribute( >+ varName, PAGE_SCOPE); > } > } > } > } > >- /** >+ /** >+ * Obtain the page context for the invoking tag/page. >+ * >+ * @return The page context for the invoking tag/page >+ */ >+ protected PageContext getInvokingJspCtxt() { >+ return invokingJspCtxt; >+ } >+ >+ /** >+ * Obtain the page context for the invoking JSP page. Where iterative tags >+ * are in use this will eb idfferent to {@link #getInvokingJspCtxt()}. >+ */ >+ private PageContext getOuterInvokingJspCtxt() { >+ PageContext pc = invokingJspCtxt; >+ while (pc instanceof JspContextWrapper) { >+ pc = ((JspContextWrapper) pc).getInvokingJspCtxt(); >+ } >+ return pc; >+ } >+ >+ /** > * Checks to see if the given variable name is used as an alias, and if so, > * returns the variable name for which it is used as an alias. > *
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46339
:
22991
| 23055 |
23094