So far, the arguments have been based on whether it is
better for the page designer or Java developer. How
about performance? IHMO, it would be interesting to
find out the timing for each of the three approaches.
I would agree with the Velocity's author that JSP
taglibs is no much better than ColdFusion tags if
performance is not addressed.


--- Incze Lajos <[EMAIL PROTECTED]> wrote:
> On Sun, Mar 04, 2001 at 08:11:31PM -0800, Martin
> Cooper wrote:
> > Niall's revised example is *almost* right. Here's
> a fixed version of it:
> > 
> > <html>
> > <head><title>Hello</title></head>
> > <body>
> > <h1>
> > <% if (request.getParameter("name") == null) %>
> >           Hello World
> > <% else %>
> >           Hello, <%= request.getParameter("name")
> %>
> > </h1>
> > </body></html>
> > 
> > The difference is that in order to print out the
> name parameter, you need to
> > use an expression rather than a scriptlet (i.e.
> <%= ... %> rather than <%
> > ... %>).
> > 
> > Of course, with Struts, you could write this
> without scriptlets altogether:
> > 
> > <html>
> > <head><title>Hello</title></head>
> > <body>
> > <h1>
> > <logic:notPresent parameter="name">
> >           Hello World
> > </logic:notPresent>
> > <logic:present parameter="name">
> >           <bean:parameter id="name" name="name"/>
> >           Hello, <bean:write name="name"/>
> > </logic:present>
> > </h1>
> > </body></html>
> > 
> > Hope this helps.
> > 
> > --
> > Martin Cooper
> 
> 
> I think the "canonical" solution in JSP is something
> like this:
> 
> ---
> <jsp:usebean id="name" scope="request"
> type="java.lang.String">
>   <jsp:setProperty name="name" value="Word" />
> </jsp:usebean>
> 
> <html>
> <head><title>Hello</title></head>
> <body>
> <h1>
> Hello <%= name %>
> </h1>
> </body></html>
> ---
> 
> On the other hand I do share Jon Stevens' views that
> this syntax
> is really not for page design people.               
>       incze


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

Reply via email to