Total Pageviews

Monday, November 1, 2010

Showing error and success messages in Liferay

In JSP:

<liferay-ui:error key="ErrorKey" message="ErrorMessage" />
<liferay-ui:success key="SuccessKey" message="Success Message" />

In Action Class:
SessionErrors.add(req, "ErrorKey");
SessionMessages.add(req, "SuccessKey");

4 comments:

  1. I am looking for such type of informative news and i get through this blog so i am very much thankful to you for sharing such a great information.
    - liferay portlet

    ReplyDelete
  2. Hello, Have you got a svn of this examples? I have problems constructing the project.

    ReplyDelete
  3. Apoorva Prakash ,

    I created registration form after entering data and click register then I made redirect to login portlet.Its all working fine but I want to display success message after it redirect to login portal.

    Thanks Regards,
    Abdul kader

    ReplyDelete
    Replies
    1. As you are operating among two portlets, you can send some parameters in request and you can add message as per your requirement in login.jsp ( in hook).
      Hope this will help.

      Delete