• Post Reply Bookmark Topic Watch Topic
  • New Topic

IOStream

 
george zhao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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 ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I was wondering if george's templates only contained static content.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!