Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chingovan/cd1cf086c50acb252884bbc1565cea4b to your computer and use it in GitHub Desktop.
Save chingovan/cd1cf086c50acb252884bbc1565cea4b to your computer and use it in GitHub Desktop.
package com.opensource.techblog.portlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
public class PhaseAndLifecyclePortlet extends MVCPortlet {
//define log for this class
private static final Log _log = LogFactoryUtil.getLog(PhaseAndLifecyclePortlet.class.getName());
//This method is defined in MVCPortlet
@Override
public void init() throws PortletException {
_log.info(" This is init method without parameter");
super.init();
}
//This method is defined in GenericPortlet
@Override
public void init(PortletConfig config) throws PortletException {
String viewTemplate = config.getInitParameter("view-template");
_log.info("Init Parameter of viewTemplatei is ==>"+viewTemplate);
_log.info(" This is init method with PortletConfig parameter");
super.init(config);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment