Default objects in Liferay

There are two taglibs which we are including every time when we create portlet.

   <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineObjects />

The above statements will give 14 default objects :

actionRequest, actionResponse,    eventRequest,  eventResponse, portletConfig, portletName,    portletPreferences, portletPreferencesValues, portletSession, portletSessionScope, renderRequest, renderResponse, resourceRequest, resourceResponse

and the type of each object as follows :

javax.portlet.ActionRequest actionRequest ;

javax.portlet.ActionResponse actionResponse ;

javax.portlet.EventRequest eventRequest ;

javax.portlet.EventResponse eventResponse ;

javax.portlet.PortletConfig portletConfig ;

java.lang.String portletName ;

javax.portlet.PortletPreferences portletPreferences ;

java.util.Map portletPreferencesValues ;

javax.portlet.PortletSession portletSession ;

java.util.Map portletSessionScope ;

javax.portlet.RenderRequest renderRequest ;

javax.portlet.RenderResponse renderResponse ;

javax.portlet.ResourceRequest resourceRequest ;

javax.portlet.ResourceResponse resourceResponse ;

     
        <%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<liferay-theme:defineObjects />

The above statements will give 18 default objects :

themeDisplay, company, account, user, realUser, contact, layout, layouts, plid, layoutTypePortlet, scopeGroupId, permissionChecker, locale, timeZone, theme, colorScheme, portletDisplay, portletGroupId

and the type of each object as follows :

com.liferay.portal.theme.ThemeDisplay themeDisplay ;

com.liferay.portal.model.Company company ;

com.liferay.portal.model.Account account ;

com.liferay.portal.model.User user ;

com.liferay.portal.model.User realUser ;

com.liferay.portal.model.Contact contact ;

com.liferay.portal.model.Layout layout ;

java.util.List layouts ;

java.lang.Long plid ;

com.liferay.portal.model.LayoutTypePortlet layoutTypePortlet ;

java.lang.Long scopeGroupId ;

com.liferay.portal.security.permission.PermissionChecker permissionChecker ;

java.util.Locale locale ;

java.util.TimeZone timeZone ;

com.liferay.portal.model.Theme theme ;

com.liferay.portal.model.ColorScheme colorScheme ;

com.liferay.portal.theme.PortletDisplay portletDisplay ;

java.lang.Long portletGroupId ;


We can get these defaults objects using pageContext object which is default of the plain jsp.

Search This Blog

All the rights are reserved to this blog is belongs to me only.. Powered by Blogger.