wood burning stoves 2.0*
The moose likes JSP and the fly likes Template Engine exist like this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Template Engine exist like this?" Watch "Template Engine exist like this?" New topic
Author

Template Engine exist like this?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Here is how I would like to see a templating engine work with JSP or Velocity or whatever. Maybe someone can tell me if one exists or not.
Say I have a servlet that get's a bunch of crap from a database. And then with the information I do something like the following:
Template t = new Template();
t.setParameter("name", "Gregg");
t.display("page.jsp")
And then on the JSP (or whatever) page I have:
<TD>Name: {$name}</TD>
Now, I realize we can do this with JavaBeans and the useBean tag library, but notice the difference in the code. Personally, I think this approach looks a lot cleaner than the taglib approach.
Anyone know of anything like this?
[ September 15, 2003: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Template Engine exist like this?
 
Similar Threads
String buffer issue when dispalying a new line
%@ include and Javascript
%@ include and Javascript
please HELP html:errors in struts's jsp
xml in JSP page