We help IT Professionals succeed at work.

How to open a word document using JSP?

KirtipurItagol
on
Medium Priority
3,145 Views
Last Modified: 2008-02-01
Hi experts, I have a JSP page which has a link. As soon as user clicks the link, a word document linked with that link should open up. Is there any way to do this?
Thanks
Right now I'm doing  something like :
href ="location of the word document".
Comment
Watch Question

Hi,

If you specify something like
<a href="your doc location" target="_blank">...</a>

It should run your word document editor automatically.

David

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Dave, that's not working...any other options on hand??

Author

Commented:
actually Dave, it's opening the word document but it is not displaying properly. I get something like [][]#% like that...do i need to set something up so that it will display the fonts correctly??
Hi,

If you try to open it using Word manually, is it displaying properly?

David

Author

Commented:
yes it is displaying properly!!
That's weird.

Are you sure that the location is correct? Maybe if possible, you can send me the email document to my email. If so, I will provide you with my email address later on.

David
Principal Solutions Architect
CERTIFIED EXPERT
Top Expert 2006
Commented:
<a href="doc location" type="Content-Type: application/msword; " target="_blank">link</a>

this may work else there is one way using java script but the problem is it works only for IE i believe.

check out here is the link.

http://p2p.wrox.com/topic.asp?TOPIC_ID=17029
if you type the location of doc directly in a new browser how it responds??
Commented:
Hi,

take a look here

http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21777975.html

you may need to use a servlet to handle the download. Change the content-type to application/ms-word.

fargo
Siva Prasanna KumarPrincipal Solutions Architect
CERTIFIED EXPERT
Top Expert 2006
Commented:
<a href="doc location" type="Content-Type: application/msword; " >link</a>

i think this will do.
just try & tell.
bye
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.