怎样让struts2的s:radio标签默认选中一个?

来源:互联网 发布:nginx jetty 区别 编辑:程序博客网 时间:2024/04/29 02:24
 

s:radio标签的value属性就是用来预选的,但是你必须加上单引号。
例:    <s:radio
     list="%{@com.gjsz.oa.cfg.service.DictCacheProvider@DICT_LIST_MAP.get('teacher_type')}"
     name="teacherType"
     listKey="keyCn"
     listValue="keyCn"
     id="teacher_type"
     onclick="teacher_type();"
     value="'内部培训'"
     >
    </s:radio>

注:“内部培训”是集合中的一个元素。