• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to update an RTF template file in java?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to open an RTF tempalte file and replace strings like "Insert Name here" with data from the database, then write out the new RTF file
I am using Java with Struts.
I don't need to create, or display the RTF template file
google has brought back RTFTemplate but it talks about Spring, Velocity, XML which I would rather not have to get into

Thanks
Rod
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If files aren't too big and you have figured out how to read them properly, then look into StringBuilder class. That might be the answer.
 
Rod McLure
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no, I haven't figured out how to open or read an RTF file
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A templating engine like Velocity or FreeMarker should do nicely. Spring or any kind of XML needn't be involved.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rod McLure wrote:no, I haven't figured out how to open or read an RTF file


An RTF file is a plain text file. Open it in Notepad or any text editor and see for yourself.
 
Rod McLure
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, I found this, does what I want
http://forums.sun.com/thread.jspa?threadID=791257&start=15
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic