Monssef
Monssef

Reputation: 182

Struts 2 - Select default value

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

Upvotes: 1

Views: 6068

Answers (1)

Roman C
Roman C

Reputation: 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.

Upvotes: 6

Related Questions