如何使用ajax在struts 2中上传文件
最佳答案
下载Struts2 jQuery Plugin像平常使用 Struts2 一样进行操作。
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head/>
</head>
<body>
<s:form id="form" action="AjaxTest">
<s:file name="myFile" ... />
<sj:submit value="Submit Form" targets="myAjaxTarget"/>
</s:form>
<div id="myAjaxTarget">
</div>
</body>
</html>
关于ajax - struts2中使用ajax上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5270288/