• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I Process rtf file  RSS feed

 
Sridhar Raman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following requirements.
I want a Letter generated by calling jsp page which contains some predefined text with embedded data from database. This can be achieved by jsp. But i want the user to modify the letter if he wished so the output file should be in rtf format. Can i achieve it.
Can I tell servlet engine to process all files ending with .rtf also in tomcat if yes how
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JFOR project has a system for converting XML to RTF format documents:
http://www.jfor.org/
I have not used it and would be interested in hearing if you get it working.
Bill
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I have an app that output a dynamic RTF document, and I'd show it to you except it's broken at the moment (converting over to Struts).
For a simple JSP approach, you could compose the boilerplate in WORD, output to RTF, take the RTF and add JSP functionality (note especially to set the content-type and content-disposition headers!) and embed scriptlets to insert the dynamic parts, then save as a JSP file.
Then in your web.xml file, set up a mapping such that, say, "formletter.rtf" maps to "formletter.jsp".
There are some client-side considerations, however. Windows users who don't have WORD will see it come up in WordPad. Non-windows users may not be able to read it at all. And even for those who do have WORD, the exact page layout isn't guaranteed, since WORD does its final typesetting based on the fonts and printer driver installed on the client's machine. When any of these is an issue you should consider outputting a PDF document instead.
 
Sridhar Raman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim
I would really appreciate if you send me the boiler plate word and all stuff needed.
my email id is shriya@hotmail.com
 
Sridhar Raman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then in your web.xml file, set up a mapping such that, say, "formletter.rtf" maps to "formletter.jsp".
How this is done in web.xml

(note especially to set the content-type and content-disposition headers!)
How
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!