servlet实现文件下载demo

一:web.xml配置servlet入口
<span style="font-size:18px;"><strong>       <servlet>
	   <servlet-name>DownLoadAttachmentServlet</servlet-name>
	    <servlet-class>com.bright.servlet.DownLoadAttachmentServlet</servlet-class>
	</servlet>
	<servlet-mapping>
	   <servlet-name>DownLoadAttachmentServlet</servlet-name>
	   <url-pattern>/downloadAttachment.do</url-pattern>
	</servlet-mapping>
	</strong></span>


二:Servlet实现 



三:调用方式  XXXX/downloadAttachment.do注意用post方式提交

你可能感兴趣的:(servlet,下载)