我在netbeans 8.1上使用struts2 2.3.15应用程序。我使用了bootstrap和jquery 1.11.x。显示效果很好,但所有表格都提交了两次。如果我删除jquery.js文件,那么表单运行良好,但ui失败。尝试使用struts2的bootstrap插件,但出错。 Caused by: Unable to load bean: type:org.apache.struts2.views.TagLibraryDirectiveProvider class:com.jgeppert.struts2.bootstrap.views.BootstrapTagLibrary - bean - jar:file:/D:/server/application/build/web/WEB-INF/lib/struts2-bootstrap-plugin-2.0.4.jar!/struts-plugin.xml:27:148
提前致谢。
<%@ taglib prefix="s" uri="/struts-tags"%><!-- Bootstrap core CSS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<!-- Custom styles for this template -->
<link href="css/sub.css" rel="stylesheet">
<link href="bootstrap/css/bootstrap-switch.css" rel="stylesheet">
<link href="bootstrap/css/main.css" rel="stylesheet">
<s:form action="AddNewBook" method="post" onsubmit="return validatepost();">
<table class="table">
<tr><td>Book Type </td>
<td > <s:checkbox name="booktype" data-on-text="New"
data-off-text="Old" width="200px" checked="true" />
</td><td>Binding </td>
<td><s:textfield cssClass="form-control" name="binding" placeholder="" />
</td>
</tr> <tr>
<td></td>
<td><s:submit name="submit" cssClass="btn btn-success btn-block" value="Post your book" />
</td><td></td>
<td></td>
</tr>
</table>
</s:form>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="javascripts/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="javascripts/docs.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="javascripts/ie10-viewport-bug-workaround.js"></script>
<script src="bootstrap/js/bootstrap-switch.js"></script>
<script src="bootstrap/js/highlight.js"></script>
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="javascripts/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="javascripts/ie-emulation-modes-warning.js"></script>
<script language="javascript" src="javascripts/minifunctions.js" type="text/javascript"></script>
<script language="javascript" src="javascripts/securetext.js" type="text/javascript"></script>
<script src="javascripts/moment.min.js"></script>
<script src="javascripts/bootstrap-datepicker.js"></script>
<script src="javascripts/bootstrap-datepicker.en-GB.js" charset="UTF-8"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="javascripts/html5shiv.min.js"></script>
<script src="javascripts/respond.min.js"></script>
<![endif]-->