我有使用 netbeans 8.1 的 struts2 2.3.15 应用程序。我使用过 bootstrap 和 jquery 1.11.x 。显示效果很好,但所有表单都提交了两次。如果我删除 jquery.js 文件,则表单运行良好,但 ui 失败。尝试为 struts2 使用引导插件,但出现错误。 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]-->