Velocity 1.4 Released 29
JohnA writes "After what seemed to be a 30 year beta period, the Apache Jakarta team has made available the final release version of Velocity 1.4. If you're not familiar with Velocity, it's one of the most powerful and popular templating engines around. And, as an added bonus, a DreamWeaver plugin was also released."
About time... (Score:3, Funny)
Project Platypus Overview:
"Similar to Velocity, but with some important differences: Mainly, we've added several reptilian characteristics which include using the same opening for reproduction and eliminating waste products, the ability to lay eggs, cervical ribs, and local ascorbic acid synthesis in the kidney. Also, Project Platypus can swim."
Re:About time... (Score:3, Interesting)
Not trolling here: if Velocity is, as you say,
Does that imply that there is a "standard" or in your opinion better templating project in the Jakarta project?
I've been interested in learning Java/JSP/etc. and would love to hear your recommendation on a good engine to study.
Re:About time... (Score:2)
Re:About time... (Score:4, Informative)
Re:About time... (Score:1)
Once you learn it and loathe it, then you can move on to others.
I personally think GroovyPages [codehaus.org] looks like it could be a much better solution than anything else I've seen in the Java world. But then I like having the option to write powerful code in the presentation layer, while the whole point of Velocity i
Why? (Score:4, Insightful)
Re:Why? (Score:5, Informative)
It is hard to debug, and encourages bad practices like putting some java code directly into the JSP, which then becomes a logic and presentation layer instead of just presentation. JSP is the thing you'd want to create a quick and dirty app, but it's sadly an enterprise standard. Now you can try to force everyone to use it as a sole presentation layer, but in many cases, it's very tempting to juste add a little scriplet, because it gets the job done. Then one day you realize your CMS or whatever has become very hard to maintain because there is logic everywhere and you have to recode the whole thing to keep the maintenance costs low.
The problem is, that's exactly the type of problem that J2EE is supposed to address, but JSP makes it hard because it's too easy to shoot yourself in the foot.
Re:Why? (Score:5, Informative)
implementing business logic intertwingled with your presentation HTML, and vice versa contrariwise.
This is not a happy peanut butter cup land.
PHP and ASP have the same problem. PHP is actually even worse, because, although there are template engines for PHP, they lead to spaghetti objects, where a single aspect is smeared over umpty-booty-teen different class files. Good luck maintaining that when the project grows past 10kloc! (I won't even BEGIN to address the death-march misery that is ASP.NET.)
Struts, Velocity, and JSF together make a beautiful system, in which the classic MVC patterns apply, aspects are colocated, and presentation is sharply segrated from business logic. Now that, my friend, is a real step ahead of the competition. Websphere is the only commercial environment that really supports this stuff right now, although I expect WebLogic to catch up soon. The Dreamweaver support is velly intelesting to me as well.
It's a good time to be alive.
I'd rather use Tapestry (Score:3, Informative)
Re:I'd rather use Tapestry (Score:1, Informative)
Re:I'd rather use Tapestry (Score:3, Informative)
You can easily write your own components and have them contain other components, etc. It's really versatile and powerful. You can also get the html from a web guy, add the jwcid attribut
Re:Why? (Score:2, Informative)
PHP is actually even worse, because, although there are template engines for PHP, they lead to spaghetti objects
Smarty [php.net], the most popular PHP template engine, is actually very similar to Velocity. Velocity has a more pleasant syntax, while Smarty has more features (esp. caching). One is certainly a knock-off of the other. I don't know which was first, though.
It's Not by Design (Score:2, Insightful)
There are reasons for servlet forwarding and tag libraries; they let you do the heavy lifting in servlets and tag handlers, and just handle display in JSPs.
I say this as the author of several JSPs (some deployed in production on reasonably high-profile sites) with buttlo
Re:Why? (Score:3, Informative)
In addition, Velocity is more than just a web scripting language. (as opposed to JSP
Re:Why? (Score:2)
implementing business logic intertwingled with your presentation HTML, and vice versa contrariwise.
I'll admit my exposure to JSP is limited, but this isn't a problem I had with it when using it.
You just need to think about your application design before sitting down and coding it.
Separation of presentation and logic is simple to achieve using standard practis
Re:Why? (Score:1)
However, I think ASP.NET is better. It's a huge shift from ASP; you could say ASP to ASP.NET is like PHP to JSF. (In fact, I believe JSF was created entirely as a response to ASP.NET, though they didn't do nearly as nice a job.) ASP was (iirc) a fully interpreted HTML embedded language. ASP.NET pages are precompiled
Re:Why? (Score:2)
...intertwingled...
...vice versa contrariwise.
...happy peanut butter cup land.
...spaghetti objects...
...umpty-booty-teen...
...10kloc!
...death-march misery...
There has got to be some creative language usage award I can nominate you for, and if not, I move that we create one...
Re:Why? (Score:2, Informative)
Re:Why? (Score:3, Interesting)
Re:Why? (Score:2, Informative)
One of it's advantages is that it can be used outside of a JSP server - so normal applications can use it as a light weight template engine.
Personally I don't like Velocity, but I think it's because I'm in a very XML based environment. As a web presentation layer I use JSTL/taglib and avoid the old school JSP code 'tags'. This way it's closer to XML but I still wish the spec made it fully XML compliant.
When JSPs don't make sense I will always use XSL because the templates can be run on any platform.
Re:I've got some karma to burn too (Score:1, Informative)
What I like most about Velocity (Score:4, Interesting)
- A Small-time Nigerian Weblog Publisher [afriguru.com]
Obligatory WebMacro plug (Score:3, Informative)
WebMacro is the original templating engine that velocity is based on. Unfortunately, due to licensing issues, they were never able to merge and have now diverged enough that they are now quite different despite the base similarities.
Version 2.0b1 of WebMacro has new and exciting features as well as efficiency gains. One of the most interesting new features is actually a result of the improvements in Java technology itself. The older versions had a lot of factories and contexts in order to get around the inefficiencies of object creation and clean-up, but now, much of this has been removed or hidden because of improvments in Java garbage collection has made them supurflous.