Struts2 - Setting a property from a static list String property using OGNL not working

前端 未结 1 1955
伪装坚强ぢ
伪装坚强ぢ 2021-01-20 19:05

I\'m trying to set a hidden input value using the struts2 framework. The input value is an unchanging value, so I\'d like to set it via a static reference rather than worryi

相关标签:
1条回答
  • 2021-01-20 19:33

    You cannot nest tags like that. And to reference inner class you need to use $ sign.

    <s:hidden name="username_type"
              value="%{@com.packagename.models.UsernameModel$UsernameTypes@ALIAS}" />
    

    IMO it is better to use that kind of static variables directly in class rather than send them from JSP.

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