This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet to send RTF  RSS feed

 
ken monroe
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66200
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!