Html和struct2中select默认值

来源:互联网 发布:木马编程 编辑:程序博客网 时间:2024/06/06 07:34

 

1.        Html中select默认选中

比如:<select class="selector">

                 <optionvalue=""></option>

                 <optionvalue=""></option>

           </select>

       $(function(){

           $(". selector").val("");//val('${plateB}')

       }); 

2.        Struct2中默认选中

Java中:

private IntegerautoId;

    public Integer getAutoId() {

       returnautoId;

    }

    publicvoid setAutoId(IntegerautoId) {

       this.autoId = autoId;

    }

Jsp中

<s:select name="autoId"id="autoId"list="#request.autosList"listKey="autoId"listValue="autoName"headerKey="-1"headerValue="请选择"class="weui-select"data-options="valueField:'value',textField:'key'"style="width:160px"/>

0 0
原创粉丝点击