Struts 2 - Select default value

孤者浪人 提交于 2019-12-23 04:09:04

问题


I had two select like this :

<s:select label = "Pays " list="payss" key="pays" value="%{FRANCE}"></s:select>
<s:select label = "Categorie " list="categories" key="categorie" value="%{200}">/s:select>

The second default value works but the first is not, the lists are like this :

payss:

  1. FRANCE
  2. BELGIQUE

categories:

  1. 200
  2. 300

回答1:


Try

value="%{'FRANCE'}"

OGNL is looking for the variable FRANCE and couldn't find it, because you didn't use it in the valueStack.



来源:https://stackoverflow.com/questions/17674483/struts-2-select-default-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!