• 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

IOStream

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am a newbie.
I had create some HTML templates , and try to use IOStream read these templates the print out in Servlet.
template-->IOStream-->Servlet-->Client
Is it a stupid way?
Is it slow?
Is it thread safe?
Is there any easier way to show template by servlet?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is it a stupid way?


It's fairly out-dated

Is there any easier way to show template by servlet?


Why don't you use JSP instead ? You should not deal with html in you servlet.
[ June 28, 2007: Message edited by: Satou kurinosuke ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can still forward or include HTML templates, they don't have to be JSPs. Although that said, I have recently implemented something similar due to the need to inject client specific content from an external location, but this content is cached using OScache.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was also thinking of include, but I didn't find it very MVC-like. And it brought painful Perl memories back to mind Do you think it's still an option ?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"painful PERL memories": thanks for poking that sore!

As to "why", serving static content dynamically doesn't always make sense, but it beats 'SSI'
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I was wondering if george's templates only contained static content.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems to me this is an ideal situation for caching - if there are not too many templates. Plenty of work has been done on Java caching - for example, this Whirlycache toolkit.

Bill
 
george zhao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What i am doing looks like a savage
It is also clear for me that you'd better not use servlet to show static content. It really make no sense.Because IIS, Apatch has already done it for you.
Why I have such idea? Here is a simple web project which contains A few UserInterfaces( no more than 6) . So I suppose what I need to do is just insert dynamic content before some given line in template file then post to client.
MVC is popular, and jsp is general.I just wanna it more simple.
Thanks a lot
[ July 01, 2007: Message edited by: george zhao ]
reply
    Bookmark Topic Watch Topic
  • New Topic