• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

portlet and servlet

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what are the portlets ?
what is the difference of portlets and servlets?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vara,
A portlet is a piece of a web page that is aggregate with other portlets to form a full page. A servlet generates a full web page.
 
Greenhorn
Posts: 5
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are differences between portlet and servlet ?

Essentially, Servlets provide content that normally takes up the whole
page in a browser (unless you're using frames), and portlets provide
content that is wrapped by a window. With portlets, you can have
multiple portlets side by side with one another and each one can provide
content and functionality that is different from the other. A portlet
can provide the complete interaction for one type of application, while
another portlet can provide content for another type of application. The
portal can provide some house keeping functionality and secured single
point of entries to all of the portlets on a page. As for the
particulars (similarities/differences) between them, please continue
reading.

Here are some similarities:

* Servlets and portlets are web based components that utilize Java
for their implementation
* Portlets are managed by a portlet container similar to a servlet
container
* Both of these components generate content, which can be static or
dynamic
* Both portlets and servlets have a lifecycle that is controlled by
the container
* The client/server model is used for both servlets and portlets
* The packaging and deployment are essentially the same
* The manner in which the classes are loaded and the class loaders
that perform the work are also the same
* Lifecycle management is similar
* The Request and Response semantics are also similar

Here are some differences:

* Servlets can provide complete web pages, whereas portlets only
provide fragments. These fragments are then aggregated to form a
complete web page by the portal
* Portlets aren�t allowed to generated HTML code that contains tags
such as base, body, frame, frameset, head, html, or title. The
iframe tag can be used with caution.
* The user cannot access a portlet directly using a URL in the way
that a servlet is accessed. Instead, the URL points to the page
containing all of the portlets on one page
* Communication between the web client and the portlets is performed
through the portal
* Portlets can be provided with buttons or controls to manipulate
the portlets� window states or portlet modes
* Multiple instances of a single portlet can be placed onto the same
page
* Portlets support persistent configuration and customization
* Portlets also support user profile information
* Portlets support two scopes within the session; application scope
and portlet scope

There are several things that servlets are allowed to do, but portlets
aren�t. These include the following:

* Portlet aren�t allowed to set the character set encoding of the
response
* Portlet also aren�t allowed to set the HTTP headers on the response
* Portlet cannot manipulate the URL of the client request to the portal

Hope that helps :-)
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good information.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the render phase, a portlet generates content, that is, HTML or WML markup.( from "Portlets in Action" written by Ashish Sarin).

please clarify is this point correct " * Portlets aren�t allowed to generated HTML code that contains tags
such as base, body, frame, frameset, head, html, or title."
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

It is - the point of portlets is that there can be many of them on any given page, and that they can be placed wherever the user sees fit. So if portlets used any of the HTML tags mentioned (and thus assumed it would be located at the start or end of a page) that would interfere with the other portlets on that page.
reply
    Bookmark Topic Watch Topic
  • New Topic