开发者

Invoking methods using expression language

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜