小弟做一个项目需要用到struts的文件上传下载组件,页面如下:
<tr>
    <td>
    <table width="80%" cellpadding="0" cellspacing="0" border="0" align="center"> 
    <tr>
      <td align="right" width="200"  >
       上传路径:
      </td>
      <td height="30">
      <input name="businessId" type="hidden" id="businessId" size="20" value="<%=busId%>">
          &nbsp;<input name="file" type="file"  size="50">
      </td>
     </tr>
     </table>
     </td>
</tr>
后台提取文件名代码如下:String type = file.getFileName();
System.out.println(type);在XML中已经配了过滤器,如下:<filter> 
<filter-name>Set Character Encoding</filter-name> 
<filter-class>filters.SetCharacterEncodingFilter</filter-class> 
<init-param> 
<param-name>encoding</param-name> 
<param-value>GBK</param-value> 
</init-param> 
  </filter>   <filter-mapping> 
<filter-name>Set Character Encoding</filter-name> 
<url-pattern>/*</url-pattern> 
  </filter-mapping> 尝试解决办法: 
1:将web.xml中的GBK替换为UTF-8                无效
2:将1.2版本的struts的jar包中的upload的
   CommonsMultipartRequestHandler.class
   CommonsMultipartRequestHandler$CommonsFormFile.class替换到现在项目的jar包中来       无效
3:在action中将编码转换为utf-8                            无效 
  String type = file.getFileName();
  byte[] strby = type.getBytes();
  type = new String(strby,"utf-8");
  System.out.println(type);
以上基本就是网上提供的方法,均已尝试,技穷了。。请教各位大神,小弟在这拜谢了。。