• 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

Generate a mail with JSP?

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Struts application generates a lot of mails. Currently, a mail assembler class takes care of their composing. But it's code is quite ugly. You'll get things like this:

I would like to have a cleaner way to generate the mails. Is there some kind of way to use a JSP page (with form bean content) which is somehow parsed to a HTML mail? Or maybe another better way?

Thanks for the suggestions!
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi tim,

to my best knowledge and understanding this is not a struts specific problem. or, put it the other way round - your problem is not inherently covered by any special strut technology / approach.

sure you could develop a jsp which generates the mail text. then you can request and parse it in order to get the html-code.

actually i never thought about assembling mails this way, but sounds reasonable enough to give it a try.

i would have use ordinary pojo to build mails just as i need it, more or less the same then your StringBuilder idea.

a "enterprise" aproach might be to consider using a cms (content management system) which assembles the mail from its fragments. but that's a load of technology if you just have a few mails to generate.

hope it helps,
jan
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic