You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Crazy Dave <mu...@yahoo.com> on 2002/02/20 13:19:20 UTC

Struts vs Template Engine or Both

Hi, 

I'm a new JSP developer (previously been working with
SilverStream pages).

I've been working with Tomcat 4 & Struts and find
JSP's to be a little clumsy with the mixing of script
code and html but I am persevering because developing
my JSP skills is the best way to remain employable.

I read a little about templete engines
(velocity/turbine) but don't wish to change to them
just yet as most potential employers are sold on JSP.

I was wondering is it easy to use a combination of
JSP/Struts with a template engine and if so are there
benifits or should I really only pick one or the
other.

Is there any performance issues JSP vs Templates.

Any constructive comments on these points or related
would be appreciated.

Cheers David Cruwys (muesliflakes@yahoo.com.au)

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts vs Template Engine or Both

Posted by Phase Communcations <ma...@phase.ws>.
If find it interesting that the argument of placing scriptlets into a jsp
page is reason enough not to use them. Has anyone heard of custom tags. If
you want to avoid placing scriptlets in your page then develop a tag that
handles the data. I have been developing in jsp for a year and a half and
have NEVER put a scriptlet in a page. I have found struts/jsp to be a great
platform for separating view and control. The other thing is let's not get
religious about MVC. There may, rarely (if ever), be an instance where
someone needs to grab some data form a view (hisss). But I have seen SQL
tags and other such tag-libs that might do someone some good who is working
on a project and wants to get a portion of it done and working. Then we can
go back and put things the way they should be (MVC). I have worked in
production enivronments where you need to get it done yesterday and you have
to write sloppy code to get it done. That's life. It's nice to have options.
I see that JSP provides that. Struts allows for the flexibility. This is a
good thing.

I am not getting in to a holy war over struts/jsp versus struts/velocity. I
am just saying. Stop with the scriptlet argument its not that major of a
point and your designers don't have to see a stitch of it and they shouldn't
have to use it if you understand what you are developing with and how best
to use it.

Thanks for allowing the soundoff,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws

-----Original Message-----
From: Gabriel Sidler [mailto:sidler@teamup.ch]
Sent: Wednesday, February 20, 2002 6:13 AM
To: Struts Users Mailing List
Subject: Re: Struts vs Template Engine or Both


Dave,
a Struts user posted the following message yesterday. I think
it pretty nicely summarizes what makes Velocity templates attractive
to some developers.


> From: "Matt Ho" <ma...@xtreme.com>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Subject: RE: Velocity-Tools / Struts
> Date: Tue, 19 Feb 2002 18:57:02 -0800
>
> We've been using Struts/Velocity for some time now and we find it to be
> an extremely well matched combination.  One of the main advantages of
> Velocity is that the syntax is incredibly easy.  I can explain it to a
> designer who has never seen it before and expect them to be useful
> within an hour.
>
> One of the nicest things it enforces is the separation of presentation
> layer and business logic.  It removes the desire to "fix" problems by
> just putting a small change into the JSP via scriptlets.  It also makes
> the code a _lot_ more readable which also reduces the development time.


We are working on integrating Velocity tightly with Struts. A prototype
with several simple application examples is available here:

http://husted.com/struts/resources/velstruts.zip

This contains a *.war file. Put the *.war into the webapps directory of
a Tomcat installation and restart. Then point your browser at
http://server:port/velstruts/ to see and try the examples. We are
currently in the process of redesigning the API and putting together
documentation. I hope for a first release version in the comming weeks.
I will announce major changes on this list.

Regarding your questions:

- As you can see in the examples, JSPs and Velocity templates can be
used in the same application. No restrictions.

- Regarding the learning curve of Velocity. The language is
really simple. Less than 10 directives. Velocity templates don't
allow Java scriptlet. If you have been relying on that feature
a lot, existing applications might need some redesign to be able
to use Velocity. Velocity really enforces a clear separation between
view and control.

- Regarding performance: Many users have reported that they
obtain about the same performance with JSP and Velocity (it really
depends on the types of templates). So, performance it not an
argument for or against one of the two technologies. We plan to do
some more performance tests with a first release version.


Gabe


Crazy Dave wrote:
>
> Hi,
>
> I'm a new JSP developer (previously been working with
> SilverStream pages).
>
> I've been working with Tomcat 4 & Struts and find
> JSP's to be a little clumsy with the mixing of script
> code and html but I am persevering because developing
> my JSP skills is the best way to remain employable.
>
> I read a little about templete engines
> (velocity/turbine) but don't wish to change to them
> just yet as most potential employers are sold on JSP.
>
> I was wondering is it easy to use a combination of
> JSP/Struts with a template engine and if so are there
> benifits or should I really only pick one or the
> other.
>
> Is there any performance issues JSP vs Templates.
>
> Any constructive comments on these points or related
> would be appreciated.
>
> Cheers David Cruwys (muesliflakes@yahoo.com.au)
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts vs Template Engine or Both

Posted by Gabriel Sidler <si...@teamup.ch>.
Dave,
a Struts user posted the following message yesterday. I think
it pretty nicely summarizes what makes Velocity templates attractive
to some developers.


> From: "Matt Ho" <ma...@xtreme.com>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Subject: RE: Velocity-Tools / Struts
> Date: Tue, 19 Feb 2002 18:57:02 -0800
>
> We've been using Struts/Velocity for some time now and we find it to be
> an extremely well matched combination.  One of the main advantages of
> Velocity is that the syntax is incredibly easy.  I can explain it to a
> designer who has never seen it before and expect them to be useful
> within an hour.
> 
> One of the nicest things it enforces is the separation of presentation
> layer and business logic.  It removes the desire to "fix" problems by
> just putting a small change into the JSP via scriptlets.  It also makes
> the code a _lot_ more readable which also reduces the development time.


We are working on integrating Velocity tightly with Struts. A prototype
with several simple application examples is available here:

http://husted.com/struts/resources/velstruts.zip

This contains a *.war file. Put the *.war into the webapps directory of
a Tomcat installation and restart. Then point your browser at
http://server:port/velstruts/ to see and try the examples. We are 
currently in the process of redesigning the API and putting together
documentation. I hope for a first release version in the comming weeks.
I will announce major changes on this list.

Regarding your questions:

- As you can see in the examples, JSPs and Velocity templates can be
used in the same application. No restrictions. 

- Regarding the learning curve of Velocity. The language is
really simple. Less than 10 directives. Velocity templates don't
allow Java scriptlet. If you have been relying on that feature
a lot, existing applications might need some redesign to be able
to use Velocity. Velocity really enforces a clear separation between
view and control.

- Regarding performance: Many users have reported that they
obtain about the same performance with JSP and Velocity (it really
depends on the types of templates). So, performance it not an 
argument for or against one of the two technologies. We plan to do 
some more performance tests with a first release version.


Gabe


Crazy Dave wrote:
> 
> Hi,
> 
> I'm a new JSP developer (previously been working with
> SilverStream pages).
> 
> I've been working with Tomcat 4 & Struts and find
> JSP's to be a little clumsy with the mixing of script
> code and html but I am persevering because developing
> my JSP skills is the best way to remain employable.
> 
> I read a little about templete engines
> (velocity/turbine) but don't wish to change to them
> just yet as most potential employers are sold on JSP.
> 
> I was wondering is it easy to use a combination of
> JSP/Struts with a template engine and if so are there
> benifits or should I really only pick one or the
> other.
> 
> Is there any performance issues JSP vs Templates.
> 
> Any constructive comments on these points or related
> would be appreciated.
> 
> Cheers David Cruwys (muesliflakes@yahoo.com.au)
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>