ASF Bugzilla – Attachment 25998 Details for
Bug 49892
Wrong JNDI Name for Method Resource Injections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch that solves method based resource injection problem
patch.txt (text/plain), 1.08 KB, created by
Gurkan Erdogdu
on 2010-09-07 10:46:36 UTC
(
hide
)
Description:
Patch that solves method based resource injection problem
Filename:
MIME Type:
Creator:
Gurkan Erdogdu
Created:
2010-09-07 10:46:36 UTC
Size:
1.08 KB
patch
obsolete
>Index: java/org/apache/catalina/core/DefaultInstanceManager.java >=================================================================== >--- java/org/apache/catalina/core/DefaultInstanceManager.java (revision 993381) >+++ java/org/apache/catalina/core/DefaultInstanceManager.java (working copy) >@@ -489,7 +489,7 @@ > lookedupResource = context.lookup(name); > } else { > lookedupResource = context.lookup( >- clazz.getName() + "/" + method.getName().substring(3)); >+ clazz.getName() + "/" + getName(method)); > } > > accessibility = method.isAccessible(); >@@ -497,4 +497,16 @@ > method.invoke(instance, lookedupResource); > method.setAccessible(accessibility); > } >+ >+ public static String getName(Method setter) { >+ StringBuilder name = new StringBuilder(setter.getName()); >+ >+ // remove 'set' >+ name.delete(0, 3); >+ >+ // lowercase first char >+ name.setCharAt(0, Character.toLowerCase(name.charAt(0))); >+ >+ return name.toString(); >+ } > }
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 49892
: 25998