Posts

Showing posts with the label exception

Difference between System Exception and Portal Exception

SystemException  This  Exception caused by system problems. Examples include database connection errors and file not found errors.   System exceptions are always unexpected , and generally indicate that the   portal is misconfigured or that a critical service is unavailable. PortalException  This exceptions related to business logic. Examples include invalid input, portlet errors, and references to non existent database records.   Portal exceptions are generally caused by user error , and do not indicate that anything is wrong with the portal itself.

Hiding the Default Error message

Image
In the Liferay, when ever we get the exception by default  error message will be displayed. So how to remove that message as below? Just add the below code at the class level where your excepting the error can occur. Code as follows as SessionMessages.add(actionRequest, (LiferayPortletConfig)portletConfig.getPortletName() + SessionMessages. KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); Thats it , we have disabled the default error message. Anyhow we are discussing about the error message, here we will discuss how to create the error message, Creating the Error message in the Liferay . In Class : SessionErrors.add(actionRequest, "error-key"); In JSP: <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> <liferay-ui:error key="error-key">        <liferay-ui:message key="validation-perference-exception" /> </liferay-ui:error>