Java在浏览器中显示Word文档. [英] Java display a Word Document inside a browser.

查看:1268
本文介绍了Java在浏览器中显示Word文档.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在搜索使用JAVA(jsp或servlet)在Web页面内显示DOC文件内容的代码,但是我找不到运气.有人可以给我看一个例子还是一个链接.

此计划的简要概述:
一个允许用户查看Word文档(无法编辑或下载Doc文件)的Web应用程序

谢谢...

Hi,
I am searching a code for displaying the content of a DOC File inside a Web Page using JAVA(either jsp or servlet) but I have no luck finding it. Can someone show me an example of this or just a link.

A little overview of this Program:
A Web Application that allows user to view a Word Document(unable to edit or download the Doc File)

Thanks...

推荐答案

一个并不能简单地在浏览器中显示word文档.
因为浏览器无法理解文档文件.

您可以做的是获取一个不错的程序为您打开该文件.
您可以要求操作系统向您显示该程序,然后让该程序打开该doc文件:

one does not simply present a word document in a browser.
Because a browser cannot understand doc files.

What you can do is to get the decent program to open that file for you.
You can ask the OS to show you the program and then let the program open that doc file:

final Program p = Program.findProgram("doc"); // find program to open doc file
p.execute(printFilePath); // let program open doc file



这是非常安全的,例如通常使用PDF完成.
如果未安装任何程序,则会显示一个下载对话框窗口.



That is pretty safe and for example often done with PDF.
If no program is installed you''ll get a download dialog window.


关注链接
http://www.eggheadcafe.com/community/asp-net/17/10136951/display-word-document-in-aspnet-control.aspx [ http://www.dotnetspider.com/forum/31319- display-word-document-web-browser-asp-net.aspx [
follow links
http://www.eggheadcafe.com/community/asp-net/17/10136951/display-word-document-in-aspnet-control.aspx[^]
http://www.dotnetspider.com/forum/31319-display-word-document-web-browser-asp-net.aspx[^]


这篇关于Java在浏览器中显示Word文档.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆