Share

Portelt Introduction


Portlets are pluggable user interface components that are managed and displayed in a web portal.If you are aware of servlets, then you should know similarities between Servlet and Portlet
.

Similarities between servlets and portlets

  1. Both servlets and portlets use the web.xml as deployment descriptor.However,Portlets have an additional deployment descriptor portlet.xml to define the portlets.
  2. Portlets have Context interface which allows developer to access the Portlet application under which portlet is running.This is similar to Servlet’s context interface.
  3. Portlets have their own config  object,PortletConfig, Which can be used to access the properties with in portlet.xml.This is also like ServletConfig.
  4. Listeners and Wrappers used by the portlets are still declared in a web.xml for both.
  5. Both Lifecycle’s managed by containers only(PortletContainer,ServletContainer)
  6. Both produces the dynamic content.
  7. Both interact with Web client via request,response paradigm.
  8. Instead of HttpServletRequest and HttpServletResponse object,Portlet expect ActionRequest or RenderRequest object and ActionResponse or  RenderResponse.

Different from Servlets

  1. Portlets generate markup fragments,not complete documents.
  2. Portlets are not directly URL accessible.We can access the portal URL containing the portlet.
  3. Portlet can’t generate arbitrary content,since the content generated by portlet is going to be part of Portal page.If server asking for html/text then all portlets should generate html/text content.If it asks WML then all should generate WML.

No comments:

Post a Comment