struts2 下载文件时struts.xml的配置

struts2 下载文件时struts.xml的配置
<? xml version="1.0" encoding="UTF-8"  ?>
<! DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"
>

< struts >

< package  name ="upload"  extends ="struts-default" >
< action  name ="upload"  class ="poi.UploadAction" >
< interceptor-ref  name ="fileUpload" >
< param  name ="allowedTypes" >
application/vnd.ms-excel,application/actet-stream
</ param ><!-- 如果上次的文件类型不对,则会在action之前拦截,并清空页面上传文件 -->
</ interceptor-ref >
< interceptor-ref  name ="defaultStack" />
< param  name ="savePath" > /upload </ param >
< result  name ="input" > /upload.jsp </ result >
< result > /succ.jsp </ result >
</ action >
</ package >

</ struts >

bmp:image/bmp

png:image/n-png

jpg:image/jpg

word:application/msword

  excel:application/vnd.ms-excel

 

有些地方有可能是:

  bmp:image/bmp

png:image/n-png

jpg:image/pjpeg

word:application/actet-stream

excel:application/actet-stream



你可能感兴趣的:(struts2 下载文件时struts.xml的配置)