Saturday, March 26, 2011

What are differences between portlets and servlets?

Portlets differ in the following aspects from servlets:

• Portlets only generate markup fragments in the render method, not complete
documents. The Portal aggregates portlet markup fragments into a complete portal
page
i.e portlets wont generates html , head ,title, body ..etc tags ...Its portal
duty to include content generated by portlets within these tages


• Portlets can only be invoked through URLs constructed via the portlet API.

We can construct URL and invoke servets on the server.. developer does this
at development time.

Ex: http://localhost/banner/LoginServet?user=suresh&password="suresh123"

We are not able to construct URL like this for a portlet.... we need to use portlet
API to generate an URL


• Web clients interact with portlets through a portal system



• Portlets have more refined request handling, i.e.
action requests,
event request,
render request and
resource requests

• Portlets have predefined portlet modes and window states that indicate the
function the portlet is performing and the amount of real estate in the portal page

No Modes for Servlets

• Portlets can exist many times in a portal page

No comments:

Post a Comment