Struts 2 - 选择默认值 [英] Struts 2 - Select default value

查看:153
本文介绍了Struts 2 - 选择默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个选择如下:

<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

payss:


  1. FRANCE

  2. BELGIQUE

类别

categories:


  1. 200

  2. 300


推荐答案

尝试

value="%{'FRANCE'}"

OGNL正在寻找变量FRANCE并且找不到它,因为你没有在 valueStack 中使用它。

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

这篇关于Struts 2 - 选择默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆