At 01:50 AM 12/18/99 -0800, Joel Parker Henderson wrote:

>Hi all,
>
>In the discussion of JSP and Servlets, I want to be sure
>that everyone understands something very very important:
>compiled JSP and Servlets are *exactly* the same thing.
>
>When you write a JSP, you write in a markup language
>that looks like XML or HTML with some special tags.
>The first time anyone uses your page, the server
>automatically compiles the JSP into a Servlet.
>So there is no such thing as executing a JSP--
>your server is truly executing a Servlet.
>
>Anything you can do in JSP, you can do in
>a servlet-- because a JSP *becomes* a servlet.
>
>However, servlets are more powerful than JSP.
>The tradeoff is that servlets are more complex,
>especially for web designers who only know HTML.'

How so?  AFAIK all of the application objects available to servlet 
programmers (request, response, session, etc.) are equally available as JSP 
objects.  Moving logic from a JSP to a servlet, I had to write 
introspection utilities to replicate the JSP bean property interface, 
particularly the automatic conversion of request parameter Strings to the 
appropriate bean property class, and the automatic assignment of all 
parameter values to bean properties of the same names via the 
'property="*"' clause of the 'jsp:setProperty' tag.

This is not to advocate cramming all sorts of java logic into a JSP -- IMHO 
that would be absolutely the wrong thing to do, as it misses the point of 
separating presentation and content.  But you can if you want to.



>The JSP and Servlet model is similar to the ND template model.
>In the ND template model, the first time anyone uses your page,
>the ND server automatically compiles your ND template (SPG)
>into a chunk of executable Java code. The ND server can make
>many optimizations for speed, caching, database pooling, etc.
>
>The important difference between JSP/Servlets and ND templates
>is that JSP/Servlets are a Sun standard, and will be supported
>by many webservers and app servers (including ND5 & IAS6).
>In contrast, ND templates only work within ND-- but they
>are much faster because ND can provide the optimizations,
>and they are usually much easier to create because you
>can use the point-and-click features of the ND studio.


Competitors are selling point/clicky IDEs for JSPs, beans, and servlets 
now.  There is some discussion in our shop now about the tradeoffs of 
pointy-clicky development environments vs. complete portability and 
separation of content and presentation.  Ideally there would not be any 
tradeoff, but from what I have seen, code generators tend to generate 
app-specific code that extends proprietary classes (sound familiar?), and 
the JSPs that are produced have tags for servlets or java beans that gush 
out most of the HTML, so that you can't edit the presentation by editing 
the JSP.  This could be the right model if everyone in your shop works in 
the IDE and understands the logical structure of the application objects, 
perhaps not if you have non-programmer web designers who just want to use 
some HTML-oriented editor, particularly if they are already using one for 
everything else they are doing.

-- Curt, tND


>So my take home advice is...
>
>If you like HTML, use JSP. If you like coding, use Servlets.
>If you like the ND Studio, then use the ND templates for now;
>you will eventually want to migrate to JSP and/or Servlets,
>and we are building tools to help automate this migration.
>
>No matter what you use, JSP or Servlets or ND templates,
>the most important thing is to clearly understand how to
>separate your logic: any reusable logic should go in a
>Java class by itself, typically a Java Bean or EJB.
>
>Cheers,
>
>Joel
>
>home: [EMAIL PROTECTED]
>work: [EMAIL PROTECTED]
>
>
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to