实现功能:
1、Excel模板下载
2、导入excel
一、jsp效果和代码
1 <form id="uploadForm" target="frameFile" class="bs-docs-example form-horizontal" method="post" action="<%=path %>/webCenter.do" enctype="multipart/form-data"> 2 <input type="hidden" id="conId" name="conId" value="<%=conId%>"> 3 <input type="hidden" id="code" name="code" value="<%=code%>"> 4 <input type="hidden" name="method" value="insertUserInfo"> 5 <table cellpadding="0" cellspacing="0" border="0" style="width:600px;margin:20px auto;text-algin:left;"> 6 <tr><td colspan="4"><input id="dyId" type="hidden"/></td></tr> 7 <tr><td colspan="3"><a href="/center/file/userInfoModel.xlsx" id="downloadModel" name="downloadModel" style="margin-left:7px;"><u>点击下载人员模板</u></a></td></tr> 8 <tr><td colspan="4"><br/></td></tr> 9 <tr><td colspan="3"><input id="files" name="files" type="file" style="width:200px;"/></td></tr><!-- background:url('/center/images/uploadImg.png') no-repeat 0px 10px; --> 10 <tr><td colspan="4"><br/></td></tr> 11 <tr> 12 <td colspan="4" style="text-align: center;"> 13 <hr style="width:720px;border-width: 0.3px;margin-left:-10px;"> 14 <button id="tiJiao" type="button" class="czbtn" style="width:100px;font-size: 16px;">导入</button> 15 </td> 16 </tr> 17 </table> 18 </form>