tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Bauman" <>
Subject Re: Taglibs Article
Date Sat, 26 May 2001 02:05:23 GMT
> Now, I wonder if I could successfully rekindle a Velocity vs. JSP
> flamewar ... <evil grin> ... don't ask me, I'm strictly a servlet guy.
> Mixing business and presentation logic is exhilirating, kinda like
> running with scissors or jumping in the pool less than 30 minutes after
> a meal.
> - Christopher

I'm having a lot of fun with Velocity right now. It has a distinct advantage
over JSP in one area for me: it'll run outside of a Servlet Container
easily, and very nicely thank you.

As far as mixing presentation logic and business logic together, well, you
can do that with Velocity, too. Although it makes you think longer and
harder about it. Here's a recent template snippet I wrote. This is something
you wouldn't necessarily be proud of doing with Velocity.


#foreach( $event in $events )
  $yapper = $meeting.getParticipation( ((MeetingEvent)$event).getFromId() ) 
  #if( $repRole.equals($yapper.getRole() )
    $repId = $yapper.getParticipantId()
    <font color="$black"><b>$yapper.getName()</b></font>
    <font color="$blue"><b>$yapper.getName()</b></font>
  #if ( $event.getClass().getName().equals($chatEventType) )
    (($event).getStoredData() <br>
  #else if( $event.getClass().getName().equals($urlPushedEventType) )


Although I think I can clean this up a lot using #macro, it shows how you
can use the dark side of the force even with a great tool like Velocity.

Nick Bauman
Software Developer
3023 Lynn #22
Minneapolis, MN
Mobile Phone: (612) 810-7406

View raw message