可以使用 Bootstrap 创建 Struts2 复选框吗?

Can Struts2 Checkbox be created with Bootstrap?

我想知道 struts2 <s:checkbox> 是否可以在 bootstrap 表格下创建。请查看我的 jsp 代码。复选框没有出现。如果我像 input type="checkbox" 这样的正常方式创建一个复选框,它就会显示出来,但我必须使用 struts2 标签创建它才能使用 struts2 操作处理表单。

jsp

<s:form action="exportDocumentExport" namespace="/esignmain/documentExport" name="documentExportForm" theme="bootstrap" cssClass="form-vertical">
        <%-- Message --%>
        <div class="message">
            <s:if test="message != null">
                <strong style="color:#7F0E11"><s:property value="message"/></strong>
            </s:if>
        </div>

    <s:if test="message == null">
    <div class="scrollView11">
        <table id="eSignUsers" class="table table-hover">
            <thead>
                <tr>
                    <th><s:text name="S.NO"/></th>
                    <th><s:text name="Document identifier"/></th>
                    <th><s:text name="Name"/></th>
                    <th><s:text name="Description"/></th>
                    <th><s:text name="Active"/></th>            
                </tr>
            </thead>
            <tr>
                <s:iterator value="documentList" status="status">
                    <tbody>
                        <tr>    
                            <td><s:property value="#status.count" /></td>
                            <td><s:property value="identifier" /></td> 
                            <td><s:property value="name" /></td>
                            <td><s:property value="description" /></td>
                            <td><s:property value="active" /></td>
                            <td><s:checkbox name="checked" fieldValue="%{id}" value="false"/></td>  
                        </tr>       
                    </tbody>                                
                </s:iterator>
            </tr>
            <tr>
                <table class="table table-striped">
                    <tr>
                        <h5>Showing <span id="totalRows" class="label label-success"></span> total records</h5>
                        <s:submit key="Export Document" value="Export Document" type="button" class="btn btn-sm btn-success" name="Export_Document" theme="simple" onclick="return evalGroup()"><span class="glyphicon glyphicon-export"></span> Export</s:submit>
                    </tr>   
                </table>
            </tr> 
    </table>
</div>  

谢谢

我猜您想使用 <s:checkbox>

创建一个 Bootstrap 样式的复选框

试试这个:

<div class="checkbox">
  <label>
    <s:checkbox name="..."/>
    Your label here
  </label>
</div>

我会推荐 Struts2 Bootstrap 插件项目。它处理提供的 jsp tempaltes

中的所有 bootstrap 标记

http://struts.jgeppert.com/struts2-bootstrap-showcase/index.action