Doug Kirk <[EMAIL PROTECTED]> writes:

> Hmmm...I don't want to rain on any parades, but I'm just wondering why
> you didn't want to use Velocity, as it accomplishes the same thing and
> it's already written and well-supported?

I do use Velocity, and am happy with it in the contexts in which I
use it.

However, it didn't seem to quite fit here.  I wanted the source pages
to be plain old HTML, to the greatest extent possible.  So consider
something like a role-sensitive navigation bar.  rather than

#if ($user.inRole('admin'))
  <a href=''>AdminFunctions</a>
#if ($user.inRole('manager'))
  <a href=''>ManagerFunction</a>

I wanted

 <a href='' ctl:if='${user.inRole("admin")}'>Admin Functions</a>

Also, I wanted to be able to leverage XML tools (XSLT) in interesting
ways.  If the control elements are expressed in XML, then I could
(for example) pass a template containing a looping construct through
an appropriate stylesheet (I'm referring here to an offline process)
and get a reasonable looking mockup.

Another thing: I figured I'd be using XSLT at runtime.  Both JSP and
vanilla Velocity are what you might call "text oriented".  Meaning
that the results of a template evaluation or JSP page evaluation
would have to be reparsed as XML on every request.  I wanted to avoid
that overhead.

Certainly I could have used Velocity.  I'm not terribly proud of
having increased the number of Java web technologies, and I always
figured I could resist the urge when it came upon me.  But it turned
out I was wrong.



This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.

Reply via email to