"Yee, Darren H" wrote:
>
> What's the advantages of using JSP over Server Side Includes and vice versa?
>
> Both JSP and SSI can receive parameters in the URL, so what is the
> difference between a JSP page and an HTML page with an SSI that calls a
> servlet (whose Service method contains the java code of the JSP)?
>
> One reason for using JSP is that all of your presentation code is in the
> .jsp file and all of the application logic is in the servlets.  Also, jsp
> files can be changed and the webserver will take care of generating the
> servlet.  With SSI you will need to recompile the servlet.  But technically,
> is there anything that I could do in JSP that I couldn't do by making a
> servlet and using SSI?

Using SSI servlets components for the business logic has some problems:
* SSI servlets are not allowed to do everything you want them to do
  in all servlet engines, such as setting cookies, redirecting to
  another page, etc.
* There's no way for an SSI servlet to abort processing of a page if
  it encounters an error or decides to redirect based on a run-time
  condition.
* There's no formal specification for the <SERVLET> tag or the behavior
  of SSI servlets, even though most engines implements them the same way.

With JSP 1.0 you can use Beans and scriptlets to handle all of the above,
and in JSP 1.1 you will be able to avoid scriptlets alltogether with
powerful components implemeted as custom tags.

That said, you can do pretty powerful things with SSI servlets today
but JSP is a better model for the future.
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to