Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Servlet to send RTF

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
I've got a JSP/HTML form page that can e-mail a letter, update a database record or print a letter on preformatted letterhead, depending on which button the user selects. The preformatted letterhead is from a Word template.

I generated RTF text from the Word template and placed some dynamic variables in it. Now I want to send the completed RTF, which is 273 kb because of the letterhead image, to the user's browser and have Word open it. I'm using the code shown below. My question is - how to I get the RTF text into the "theMessage" variable? Or do I use something besides a string var?

Thx

 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems like a simple matter of reading the file off disk and writing it to the response's output stream.

Is that what you are having issue with?
[ July 13, 2005: Message edited by: Bear Bibeault ]
 
ken monroe
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, parts of the RTF are generated dynamically (address, signature block etc.) based on session variables so I was just going to stick them in the appropriate spot in the RTF text and assign the whole mess to a string and send that to the browser.

If I go with a file, I've got to generate the same RTF, then write it to a file, then read it back in (as a stream I guess) and send it. At the moment, my Web form calls a JSP page that contains the code below, so when param.prntLetter is sent, I though I send processing to the servlet...?

Thx

 
He's giving us the slip! Quick! Grab this tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic