• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

word doc servlet filename question

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


At this point when you click the word download link it opens the download popup with the correct filename printed. If save is clicked it will open the save as box with the correct filename. BUT if we hit open the word doc opens and its title is the servlet name: "WordServlet(Read-Only)"

I am using IE 6!!
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi william,

This can help you ....





Regards
Binaya
 
william cipolli
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would I have to rewrite my previous doGet method? This servlet does both my word and pdf documents. The issue here isn't with the writeContent? I'm new to the servlet world, so i need some hand holding to understand this throughly.
 
binayakumar patel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

No need to rewrite doGet() method,
Just replace the line



with



or add this line in your code and check it is working fine or not.



Keep the other thing same. This will resolve the issue. because "inline" will try to open the attached document in the same browser... where many places IE is not support the "inline"


 
william cipolli
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



I'm assuming res and response in your code examples were supposed to be httpServletResponse italic and underlined is the code changed. It's still following the same behaivor it was before:
1) prompts user for download with correct name
2) save- saves as correct name
3) opens- as servletname(Read-Only)
4) cancle- cancels dl


3 is the problem

 
william cipolli
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Here I separated the function instead of using it for both my pdfs and word documents I used selection to pick. The pdfs should use inline to open in a ie window and word docs should load as an attachment. Everything works fine except the open word doc.

if pdf link is clicked pdf opens in new IE window
if word link is clicked download attchment pop up shows
**if open: word doc opens and title is servername(Read-Only)**
if save: opens save as window with correct filename
if cancel: cancels save

 
Let's go to the waterfront with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic