Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Template Engine exist like this?

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic