Search This Blog

Wednesday, July 24, 2013

Display error and success messages in liferay

Error Display Many times we need to display the errors messages or the success messages on the jsp pages.The way it is done is the following. Add the following the your implementation of processAction.
 //for Errors 
    com.liferay.portal.kernel.servlet.SessionErrors.add(portletRequest, "unique-error-key"); 
//for Messages 
    com.liferay.portal.kernel.servlet.SessionMessages.add(portletRequest, "unique-message-key"); 
or In Language_xx.properties add your custom message in this file like this
unique-message-key2="Success"

 TO display them in your jsp use this:

No comments:

Post a Comment

My Blog List