How to use JSTL with Struts2 ?

后端 未结 1 1725
忘掉有多难
忘掉有多难 2020-12-19 18:05

I have this code that actually works:


    
             


        
1条回答
  •  醉梦人生
    2020-12-19 18:07

    To be more comfortable with Struts2 tags and OGNL language, read and bookmark this answer.

    Since Struts2 tags only evaluate OGNL expressions (and not EL Expression, as you error clearly states), you need to access the JSTL object through the PageContext attribute (in OGNL #attr.something) specified with var :

    
        
        
  • ${link.name}
  • From OGNL Basics:

    #attr['foo'] or #attr.foo : Access to PageContext if available, otherwise searches request/session/application respectively

    0 讨论(0)
提交回复
热议问题