解决思路:
配置web工程web.xml加上
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>
修改后非常注意的要清空缓存这样才会弹出保存还是打开的窗口否则打开还是乱码.