JSP allows you to put mostly HTML (or all HTML if you don't want any java in
it), then converts it to a servlet .java code, then compiles it. Thus, you
get the same performance as if you did it as a servlet. However, because a
servlet engine creates the .java source first, it can optimize the code the
servlet produces as much if not more so than you might know how to, giving
you a performance increase you may not achieve with direct servlet coding.
This isn't to say you can't do it, but alot of programmers do not think or
worry about optimizing. A servlet engine writer would take this into account
and create perhaps the fastest possible java source that can be written. The
result is often faster page returns than had you dont it yourself as a
servlet.

Using a framework like Theseus (my own.. www.brainopolis.com/theseus) or
Struts will further speed up development and better organize your code.
Actually, speeding up development is questionable. You can just as easily
write all the code in the JSP page along with the HTML (pretty much the
opposite of writing code that returns HTML in a servlet). However, the more
scalable approach is to use a MVC framework where by your using JSP pages to
just deal with the display of html and dynamic data. I use conditional
statements in my JSP pages, but you can just as easily use Tag-libs that
make it easier. Or, if your really wanting to get away from code in your
html pages, use XSL. Return dynamic XML and apply an XSL page to the xml,
where by giving you transformed HTML output. Its an extra step, and a bit
more complicated, but it does give you the most versatile usage of your
dynamic capabilities. You can take the same XML output and render it to PDF,
RTF, WML, a different XML format, and so on. You simply apply a different
XSL for each type you want to output to. XSL isn't super easy, but the most
basic things are not too difficult to learn. I don't recommend it if your
just a single developer. You'll have to deal with the dynamic XML output AND
the XSL pages to render to HTML. Its quite a bit faster to just use JSP to
do the HTML and include looping code or what not in the pages.


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of ANGELO HADJIS
> Sent: Tuesday, June 12, 2001 8:11 PM
> To: [EMAIL PROTECTED]
> Subject: JSP vs Servlets: sample servlet project
>
>
> Here is a sample Servlet project.
>
> http://www.cantel.ca/michelinehadjis/
>
> The pictures are retieved from an SQL server. The pages are formatted
> according to entries in a couple of simple tables. What would be the pros
> and cons of writing this type of application using JSP instead of pure
> Servlets? Would there be any performance advantage? What about development
> and coding speed? Would anyone be able to comment on other similar
> development environments, such as PHP?
>
> angelo
>
>
>
>
>
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> ==================================================================
> =========
> 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

===========================================================================
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