Fetyko Jan wrote:

> One of the good reasons is that the servlet is faster then a JSP page.

This assertion cannot be supported in the general case.

I'm discounting the possible compilation delay you see the first time that you
access a page that hasn't been compiled yet (the same thing happens with servlets,
of course -- you need to recompile them when they are changed :-).  The issue at
hand is, how fast does the resulting compiled servlet run?

The answer to that question depends upon the code quality of the servlet generated
by the JSP page compiler, versus the skill of the Java programmer who wrote a
servlet that performed exactly the same functionality -- and if it does not do
*exactly* the same thing, then any performance comparison is bogus anyway.

Given that there are JSP page compilers of various quality, programmers of various
skill levels, and application requirements that range from very simple to
incredibly difficult, you can see that a generalization like the one above is too
simplistic to reflect reality.


>
> If you get 1000's hits per hour to the same URL, you want it to be fast.

Usually true -- but at what cost?  If I can get away with less developer effort,
and throw more hardware at the server, I might be *much* better off economically
(because I can use the same amount of developer time to create more applications).
"As fast as possiible" is not a universal goal -- "fast enough" is more likely to
be what is striven for.


>
> Another reason might be that with building servlets you're separating the
> presentation layer from the processing layer.
>

Going back to the original question of servlet versus JSP, you will note here one
other interesting difference -- servlets require Java programmers, while JSP pages
do not generally need them, especially if you are using good web application design
principles like separating business logic and presentation logic.


>
> Jf
>

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to