问题
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
:
- FRANCE
- BELGIQUE
categories
:
- 200
- 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