Skip to main content

Servlets vs Portlets

Basic Overview of servlet and portlet-:




S.No Servlet Portlets
1 Servlet uses deployment descriptor (web.xml) determine how URLs map to servlets Portlets also uses web.xml file however they have additional deployment-descriptor portlet.xml, which must declare all of the portlets that will be used by the portlet container
2 Servlet uses HttpServletRequest and HttpServletResponse Instead of using HttpServletRequest and HttpServletResponse portlets uses Action Request and Action Response , Render Request and Render Response
3 Web Container creates Servlet Context at the time of deploying the project , Servlet Context can be used to get configuration information from web.xml Similar to servlet context portlet uses PortletContext.
4 Servlet uses ServletConfig to get configuration information Portlet uses PortletConfig to get configuration information
5 When a request to servlet is made its load the whole html page as view Portlets generate a small fragement of portal page

Comments

Popular posts from this blog

Liferay 7.1 Topics Coming Soon stay connected

1. Liferay 7.1 Service Builder 2. Rest Service and Liferay 3. Consuming SOAP service with Liferay 7.1 4. Creating Theme With Liferay 7.1 Using Liferay IDE Using NPM 5. Create Angular NPM Module 6. Web Content Management 7. OSGI Basic 8. Liferay 7.1 with more than 1 DB 9. A sample project 10. Liferay Dev Ops

How the portal page is loaded with respective portlets

How the portal page is loaded with respective portlets When a user requests a page with a URL, 1.    The browser sends the request to the Application Server (AS). 2.    Liferay gets the page name from the URL. 3.    It goes to the layout database table and finds the related        theme and page layout. 4.    Based on the page layout, Liferay finds the portlets added        into each area of the page layout. 5.    Liferay runs the portlet and adds the output in the        portlet.vm template. 6.    Liferay interprets the portlet.vm template and adds the output        in the page layout. 7.    Then Liferay interprets the page layout and adds the output in        the portal_normal.vm template. 8.    After that Liferay interprets the portal...

Liferay Dynamic Query API

Liferay Dynamic Query API  -Liferay Dynamic Query API is an elegant feature in Liferay portlet development. -Dynamic Query API can only perform read operations against database. These we will use specially to provide search operations against database. -Dynamic Query API is independent feature and we can implement anywhere in the development like we can implement in JSP pages, Portlet Action Classes and service implementation classes. Types of Class Loader-: Here we have two class loaders 1. Portal Class Loader-:    If any class or model class in portal level then we need to use Portal Class Loader in Dynamic Query Object.    ClassLoader portalClassLoader=PortalClassLoaderUtil.getClassLoader();    We can implement dynamic query against portal level class such as User, Group, Role, Organization, Layout and Layoutset 2. Portlet Classs Loader-:    Portlet Class Loader is related to each portlet.    ClassLoader portle...