开发者

Invoking methods using expression language

开发者 https://www.devze.com 2023-01-22 09:19 出处:网络
In my spring\'s config I need invoke method \"get\" (java.lang.ThreadLocal\'开发者_Go百科s instance object). How I can do it without creating new class with \"correct\" method\'s naming (smt like \"ge

In my spring's config I need invoke method "get" (java.lang.ThreadLocal'开发者_Go百科s instance object). How I can do it without creating new class with "correct" method's naming (smt like "getValue" instead of "get")?

Thanks.


You can't. EL is following the JavaBeans convention. You have two options:

  • define a custom JSTL function that retrieves the objects
  • create a wrapper class the has, say, getThreadLocalValue() and access it via bean.threadLocalValue
0

精彩评论

暂无评论...
验证码 换一张
取 消