日期:2014-05-20 浏览次数:20868 次
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
------解决方案--------------------
struts1文件类型限制,百度下吧。
struts2是
<interceptor-ref name="fileUpload">
<param name="allowedTypes">
application/msword, application/pdf,
application/vnd.openxmlformats-officedocument.wordprocessingml.document
</param>
<param name="maximumSize">4194304</param> <!-- 最大4M 4*1024*1024 -->
</interceptor-ref>