-
JSP, SERVLETS AND BEANS
I want to know what are the differences between JSP and Servlet, when is best
to use JSP and when servlet is. I heard that JSP is as HTML code, that calls
to Bean's functions that return Strings,
that included in the HTML code is the Final Page. Otherwise I heard that
Servlet's return is Java Server Page, and I know well how to use them but
I don't know what's diference.
Thanks.
-
Re: JSP, SERVLETS AND BEANS
At its most simple level JSP is an easy to read/code version of a servlet
but is more suited to your presentation layer, it is cleaner because it is
based on tags like ASP is, servlets are the equivalent of CGI and are a wee
bit more powerful than JSP pages - JSPs become a servlet when it is
compiled (typically the first time it is requested by a browser). Both
servlets and JSP return data to a presentation media like a web browser.
Beans are used to encapsulate your business logic so you dont stick it in
your JSP pages.
Definately worth buying a book on this .... good one below.
--
Regards
John Timney
Microsoft MVP
(http://support.microsoft.com/support/mvp/program.asp)
Co-Author Professional JSP
ISBN: 1-861003-62-5
Antonio Fdez. <eafernandez@acinco.es> wrote in message
news:39c8e5e3@news.devx.com...
I want to know what are the differences between JSP and Servlet, when is
best
to use JSP and when servlet is. I heard that JSP is as HTML code, that calls
to Bean's functions that return Strings,
that included in the HTML code is the Final Page. Otherwise I heard that
Servlet's return is Java Server Page, and I know well how to use them but
I don't know what's diference.
Thanks.
-
Re: JSP, SERVLETS AND BEANS
Browse the following article for a better understanding of JSP/Servlets.
<a href="http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html">Understanding
JavaServer Pages Model 2 architecture</a>
HTH
"Antonio Fdez." <eafernandez@acinco.es> wrote:
>
>I want to know what are the differences between JSP and Servlet, when is
best
>to use JSP and when servlet is. I heard that JSP is as HTML code, that calls
>to Bean's functions that return Strings,
>that included in the HTML code is the Final Page. Otherwise I heard that
>Servlet's return is Java Server Page, and I know well how to use them but
>I don't know what's diference.
>
>Thanks.
-
Re: JSP, SERVLETS AND BEANS
1) in jsp we embedded all the scriptlet code inside HTML tag,
where as in Servlet it is the other way(you can create a dynamic page inside
the methods).
2) JSP pages, while compliation makes a servlet automatically.
3) On the server where the application is hosted( if it is shared server),
there is a possible chance of misuse of code by the authorities. where as
in Servlet you keep only .class(dot class) file so no code will be visible
or misused.
4) In JSP there are inbuild objects,where as in Servlet every thing should
be invoked.
5) Excution time is more in case Servlets.
6) during development any change of code in JSP does't need compliation.
Where as in servlet you need to complie and make class file every time.
"Ravi Kesariraman" <rkesa@hotmail.com> wrote:
>
>Browse the following article for a better understanding of JSP/Servlets.
><a href="http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html">Understanding
>JavaServer Pages Model 2 architecture</a>
>
>HTH
>
>"Antonio Fdez." <eafernandez@acinco.es> wrote:
>>
>>I want to know what are the differences between JSP and Servlet, when is
>best
>>to use JSP and when servlet is. I heard that JSP is as HTML code, that
calls
>>to Bean's functions that return Strings,
>>that included in the HTML code is the Final Page. Otherwise I heard that
>>Servlet's return is Java Server Page, and I know well how to use them but
>>I don't know what's diference.
>>
>>Thanks.
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks