In a Java web project, if you want to open a link(url, like http://localhost:8080/pe/report/test.xls , the file has been already created )to show test.xls excel file, maybe you just see some nonsense code. In order to resolve the problem, you have to add some config in web.xml:

<mime-mapping
>
  < extension > xls </ extension >  
   <mime-type>application/octet-stream</mime-type> 
</mime-mapping
>

remember: the web.xml is not the file in your project, but a config file under the servlet container, for example JBoss, Tomcat.

posted on 2006-05-12 17:48 Pearl And Allen 阅读(136) 评论(0)  编辑  收藏 所属分类: J2EE Technology

只有注册用户登录后才能发表评论。


网站导航: