Search This Blog

Monday, January 18, 2016

Remove Default Error Message in Liferay

Liferay displays a partuculat error message on each Login , e.t.c error. It reads out like this 

"You have entered invalid data, Please try again"

although we do not need this message everytime, as it is displayed on top of another error message like 

"Authentication failed. Please try again. "

So, if we need to remove the error message from the portal . We can do the following. 

Case 1: When we need to remove it entirely from the portal 

        solution : customize the "end.jsp" of "ui- error taglib"
                                     
       
       
       
       
       
       <%= rowBreak %>

Case 2: When we need to remove it only for a particular portlet.
          
        solution : customize the "end.jsp" with a condition of "ui- error taglib"

   
       
       
       if(strPortletId.equals("portlet_WAR_name")
       {
       // add your custom code here .
       }
       else
       <%{%> 
            
              
              
        
       <%}%> 
       <%= rowBreak %>
 
Other Solutions :-
 
  1. In Portlet .xml , 
 
         
            add-process-action-success-action
            false
         


 2. In java class, overrride the action method

         protected void addSuccessMessage(
         ActionRequest actionRequest, ActionResponse actionResponse) {
 
         if (!addProcessActionSuccessMessage) {
             return;
         }
          String successMessage = ParamUtil.getString(actionRequest, "successMessage");
          SessionMessages.add(actionRequest, "request_processed", successMessage);
          }









My Blog List