George Svedloff wrote:

> I have a question, and I apologize in advance if I misunderstand something
> since I do not have very much experience with JSP.
>
> How does JSP achieve separation between HTML and the logic (Java)?  Isn't
> it Java code embedded in HTML?  As such, you have an HTML file that has
> Java code right in it.  Isn't that what we are trying to avoid?
>
> George Svedloff
>

JSP can be easily used in a style that minimizes/eliminates Java logic embedded
in the pages.  In the 0.92 spec, this was called the "Model 2" approach, where
you submitted forms to a "real" servlet, which prepared response data in beans
that were stored in either the request attributes or the session attributes,
and then called RequestDispatcher.forward to a JSP page to display the
results.  The JSP 1.0 spec calls this the "Redirecting Requests" model.

Of course, the tempation to embed application logic in scriptlets will always
be there with JSP, but that does not necessarily mean that smart developers
will succumb to the temptation.  :-)

On the other hand, even if they do, a standardized scripting environment is
still IMHO better than a non-standardized template world that locks you in to a
particular vendor (even if the source code of the template engine is free, the
cost of switching later is very high).

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to