javascript - Struts2 and Struts2 JQuery Plugin compatibility -
i'm using struts2 , want ajax post upload file server side. have installed struts2 jquery plugin, think it's compatibility problem, because when load page, chrome console show problem:
<script type="text/javascript"> $(function() { jquery.struts2_jquery.version="3.6.0"; uncaught typeerror: cannot set property 'version' of undefined
i have tried other versions of plugin (3.3.0, 3.7.0), have same problem. i'm using struts2-core-2.3.1.2.
my web.xml have:
<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
and header of jsp is:
<%@ page contenttype="text/html; charset=utf-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> <!doctype html> <html> <head> <title></title> <script src="js/jquery.js"></script> <script src="js/jquery-ui.js"></script> <sj:head jqueryui="true"/> <tiles:insertattribute name="header" />
and sj:submit upload file:
<s:url id="servicesurl" action="ajaxcall"></s:url> <sj:submit name="button1" value="submit" href="%{servicesurl}" targets="myajaxtarget" ></sj:submit> <div id="myajaxtarget"> </div>
and under part of submit, chrome shows
uncaught typeerror: cannot read property 'bind' of undefined
pd: if can complete question, tell me , i'll more information
while using
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
no need of using
<script src="js/jquery.js"></script>
since <sj:head/>
generates imports needed run jquery
.
Comments
Post a Comment