码迷,mamicode.com
首页 > 其他好文 > 详细

struts2 select 默认选中

时间:2014-12-31 15:51:35      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

  • jsp:


<s:select list="#{‘1‘:‘男‘,‘2‘:‘女‘}" name="sex"/>

  • action:


private String sex;
sex属性有get/set方法。

在业务方法中设置sex = "2";select会默认选中。

struts2 select 默认选中

标签:

原文地址:http://www.cnblogs.com/azhqiang/p/4195649.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!