Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening a MS Word Document from JSP using Relative URL

 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this requirement of opening some help documents in MS Word Format.

We have the document placed in the web layer ( along with JSPs) and then we try to access the documents using the relative URL.

The full path gets replaced correctly, but the Word Document is opened in browser in text format.

<A href="/xxxxxxxx/docs/module/document1.doc" >Open A Word Document</A>

I do not have any p roblem in opening any word document from internet and ms word is already in the file types for my computer.

Any thoughts on this ??

Browser - IE 6.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Vicky",
Please check your private messages
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i changed my display name, per your policy.

Can anybody offer any suggestions for my issue ?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What container are you using?
Does it have a mime type set up for the ".doc" extension?
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Weblogic Application Server.

I do not have any entries for any MIME type in web.xml.

But it works fine for a PDF File.
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added the MIME Types to web.xml and it fixed the issue.

<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>


Thanks for your help
[ October 04, 2007: Message edited by: Vicky Mohan ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how Weblogic works but in Tomcat, there is a global web.xml file that contains all of the pre-set mime types.
I'm guessing there is a similar config file in WebLogic.

If you want to pursue it, let me know and I'll move this thread to our BEA Weblogic forum for you.

-Ben
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. I would really appreciate it.

If we could get it set globally in weblogic, it will be more appropriate.

Please forward this to weblogic group.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic