由于项目需求需要上传新闻的图片或是视频,并且可以批量编辑修改保存。
1.jsp页面:(fileId为和图片表相关联,图片id)
<input type="file" name="img" style="display: none;" οnchange="editFileStatus(<s:property value='fileId' />)" accept="video/*, image/*"/>
<input type="hidden" name="fileStatus[<s:property value='#st.index' />]" id="file_<s:property value='fileId' />" value="<s:property value='fileId' />">
<s:if test="type == 1">
<img alt="" width="320px;" height="180px;" src="<s:property value='photoUrl' />" >
</s:if>
<s:else>
<video src="<s:property value='photoUrl' />" width="320px" height="180