gpt4 book ai didi

ajax - struts2中使用ajax上传文件

转载 作者:行者123 更新时间:2023-12-02 21:30:36 31 4
gpt4 key购买 nike

如何使用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/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com