You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jon Stevens <jo...@latchkey.com> on 2001/03/14 03:28:35 UTC

FW: Velocity vs. JSP

I love email like this:

    name removed because it is forwarded without permission. :-)

-jon


> I've read the YMTD article again and I have to admit the more I read it,
> the more I agree with what you're saying.
> 
> I started off with servlets, switched to JSP/Tomcat to avoid hammering
> out HTML out of Java, but I concur that the
> edit->transform->compile->load->run is really too much. I was caught on
> a number of occasions poking around generated Java code. And it's not
> supposed to be like that!
> 
> Valid point related to scope as well. I had trouble understanding it at
> first and I don't think your average web designer would at all.
> 
> What I dislike most is the fact that it is very true that Tomcat is
> sensitive to JSP changes and sometimes fresh .class file won't work with
> what's currently loaded. Solution, restart Apache and Tomcat (mod_jk
> needs Apache to be restarted as well). Now, in my situation this is
> possible, because I do the lot (I'm running my own small web
> design/e-commerce/hosting company), but thinking of the future, it would
> be a nightmare doing that every time a web designer fiddles with a JSP.
> My server would be down half the time!
> 
> So, I'm taking a real careful approach. I'll convert a few of my
> JSP/JavaBeans projects to Velocity and then we'll see how things are
> shaping up. You might have another convert on your hands after all...
> 
> Anyway, great work and keep on it!


RE: FW: Velocity vs. JSP

Posted by Paulo Gaspar <pa...@krankikom.de>.
Ahem!...
...and, Ewan, do you intend to work with other people (designers 
included), using that method?

Just asking.
=;o)

Paulo

> -----Original Message-----
> From: Ewan Makepeace [mailto:ewan_makepeace@yahoo.com]
> Sent: Friday, March 16, 2001 17:48
> 
> ...
>
> Umm - purely accidental. Conceptually I fully agree that logic belongs
> in code, presentation in pages or templates, and never the twain shall
> meet. 
> However I already had display objects to display arbitary JSP sections
> so that I could compose composite pages, and found myself needing extra
> text and headings - pieces too small to justify JSP pages to
> themsleves. The heading class just extends the text class and wraps it
> with <Hn> tags - so it was no sweat to add a generic Tag class for
> other tags (with arbitary attributes). Next thing I knew I was writing
> out cells, rows and tables, with no worries about unmatched tags and
> with full compile time checking, and found I liked it.
> I have to point out that my application has almost no static text -
> everything is dynamic data, which is more suited to this sort of
> technique.
> Still don't worry too much - as soon as I can get the current project
> off my desk, I plan a thorough evaluation of Turbine, which will put me
> firmly back in the Velocity camp!
> 
> rgds
> Ewan


Re: FW: Velocity vs. JSP

Posted by Ewan Makepeace <ew...@yahoo.com>.
--- "Geir Magnusson Jr." <ge...@optonline.net> wrote:
[SNIP]
> > then it is not compiled at all. I confess I have been moving more
> and
> > more of my display code out of templates and into Java using a
> display
> > object model similar to ECS to hide the tags and a lot of the
> > formatting, with great results.
> 
> Stand still while we flog you... :)
> 
> Why are you moving it out?  I am sure you have a good reason - I am
> interested to hear why...
Oops - should never have said that on a Velocity mailing list :-)

Umm - purely accidental. Conceptually I fully agree that logic belongs
in code, presentation in pages or templates, and never the twain shall
meet. 
However I already had display objects to display arbitary JSP sections
so that I could compose composite pages, and found myself needing extra
text and headings - pieces too small to justify JSP pages to
themsleves. The heading class just extends the text class and wraps it
with <Hn> tags - so it was no sweat to add a generic Tag class for
other tags (with arbitary attributes). Next thing I knew I was writing
out cells, rows and tables, with no worries about unmatched tags and
with full compile time checking, and found I liked it.
I have to point out that my application has almost no static text -
everything is dynamic data, which is more suited to this sort of
technique.
Still don't worry too much - as soon as I can get the current project
off my desk, I plan a thorough evaluation of Turbine, which will put me
firmly back in the Velocity camp!

rgds
Ewan

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Re: FW: Velocity vs. JSP

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Ewan Makepeace wrote:
> [SNIP]
> Velocity certainly avoids the ugly compile time messages of JSP - but
> then it is not compiled at all. I confess I have been moving more and
> more of my display code out of templates and into Java using a display
> object model similar to ECS to hide the tags and a lot of the
> formatting, with great results.

Stand still while we flog you... :)

Why are you moving it out?  I am sure you have a good reason - I am
interested to hear why...

> [SNIP]
> For me, one of the biggest potential benefits of Velocity over JSP,
> that was skimmed over by Jon, is the way the tags are visible in the
> WYSIWYG tools like Frontpage (or even Word or Excel these days - have
> you seen how good the 'save as HTML' is in Office 2000?) My potential
> audiance here is not page designers - I believe if they can learn
> ColdFusion they can cope with JSP, but users themselves.

Amazingly, sometimes this is considered a *drawback* of Velocity, that
you don't have tag support in Dreamweaver and other tools.  Of course,
this avoids the tools rewriting your script code, mangling the reference
names, etc :)

> A user can lay
> out a report, form or document complete with colors, styles, font sizes
> and fomatting, and type Velocity tags wherever the dynamic data should
> appear, with almost zero training. Only a line or two needs adding
> before the page can be used as a Velocity template and because the tags
> appear inline, the data ends up formatted with the chosen font and
> style just as the tags were.

+1 :)

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: FW: Velocity vs. JSP

Posted by Ewan Makepeace <ew...@yahoo.com>.
I did some webapp development in 1996, when MS ASP had just come out
and was not widely used - at least not in Jakarta (Indonesia) where I
was and still am. I was initially bowled over by the power and
simplicity of being able to embed VBScript right there in my web pages,
loop over groups of tags and access databases, all with a few lines of
embedded code. (Before the anti-MS crowd get going, just try and think
what the alternatives were back then!)
However as the project grew the drawbacks became more apparent - code
mixed with HTML was visually ugly and hard to understand. Changes to,
say, the database structure entailed modifications to dozens of web
pages, and debugging support was almost non existent.
VB6 gave us support for web classes (like Servlets mixed with custom
JSP tags) which had huge potential bud were rather unreliable and buggy
in their first version. Meanwhile I had moved on to other things.
Now I am back in Web Development, but using Java. JSP has arrived, late
to the party, and with many of the same drawbacks as ASP. To it's
credit it is compliled which catches many otherwise hard to spot
errors, and speeds performance, but as far as I know I cannot force a
compile at the same time as my App - I have to start Tomcat, access the
page and see if it compiles....
Velocity certainly avoids the ugly compile time messages of JSP - but
then it is not compiled at all. I confess I have been moving more and
more of my display code out of templates and into Java using a display
object model similar to ECS to hide the tags and a lot of the
formatting, with great results. This is OK at present as I am doing the
whole project with no page designers to interface with. The No 1
advantage? If I modify a class and recompile the project, the compiler
notifies me of any broken methods, even in the display code. That is
worth a lot.
For me, one of the biggest potential benefits of Velocity over JSP,
that was skimmed over by Jon, is the way the tags are visible in the
WYSIWYG tools like Frontpage (or even Word or Excel these days - have
you seen how good the 'save as HTML' is in Office 2000?) My potential
audiance here is not page designers - I believe if they can learn
ColdFusion they can cope with JSP, but users themselves. A user can lay
out a report, form or document complete with colors, styles, font sizes
and fomatting, and type Velocity tags wherever the dynamic data should
appear, with almost zero training. Only a line or two needs adding
before the page can be used as a Velocity template and because the tags
appear inline, the data ends up formatted with the chosen font and
style just as the tags were.

rgds
Ewan

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/