aspose file tools*
The moose likes Portals and Portlets and the fly likes portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "portlet" Watch "portlet" New topic
Author

portlet

nirjari patel
Ranch Hand

Joined: Apr 23, 2009
Posts: 374
whats the difference between and servlet and portlet ?
Does portlet work on any diffrent principles or mechanism than servlet ?

thanks
Sethu Rengarajan
Greenhorn

Joined: Aug 22, 2009
Posts: 1
Portlets Vs Servlets
================

Some of the basic similarities are:

Both are Java technology based web
components
1 Life-cycle is managed by a specialized
container
– Servlet by servlet container
– Portlet by portlet container
2 Both generate dynamic content
3 Both interact with web client via a
request/response paradigm

Differences:
===========

Portlets only generate markup fragments, not
complete documents
? Portlets are not directly bound to a URL
? Web clients interact with portlets through a portal
system
? Portlets have a more refined request handling
– action requests and render requests
? Portlets have predefined states
– portlet modes and window states
? Portlets can exist many times in a portal page


Extra Features of Portlets
====================

? Portlets have means for accessing and storing
persistent configuration and customization data
? Portlets have access to user profile information
? Portlets have URL rewriting functions for creating
hyperlinks within their content
– allow portal server agnostic creation of links and
actions in page fragments
? Portlets can store transient data in the portlet
session in two different scopes
– application-wide scope
– the portlet private scope


Servlet Features Forbidden to Portlets
=========================

? Setting the character set encoding of the
response
? Setting HTTP headers on the response
? The URL of the client request to the portal


Servlet Features that areleveraged by Portlets
=================================

? Portlets can leverage servlets, JSPs and JSP
tag-libraries for generating content
– Content should be markup fragment
? A portlet can call servlets and JSPs using a
request dispatcher


Integration between the two
===================

? Attributes set in the portlet request are
available in the included servlet request
? Attributes set in the portlet session are
accessible from the servlet session and vice
versa
? Portlet and the included servlet or JSP
share the same output stream


Hope the above helps
-Sethu Rengarajan

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: portlet