Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Prevent SessionMessages "Your request processed successfully." Corné Aussems September 14, 2010 5:53 AM
RE: Prevent SessionMessages "Your request processed successfully." Nagendra Kumar Busam September 14, 2010 8:37 AM
RE: Prevent SessionMessages "Your request processed successfully." Amos Fong September 14, 2010 9:58 AM
RE: Prevent SessionMessages "Your request processed successfully." Corné Aussems September 15, 2010 2:06 PM
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair November 28, 2010 9:36 AM
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha September 19, 2011 7:00 AM
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair September 19, 2011 9:36 PM
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha September 19, 2011 9:58 PM
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair September 20, 2011 1:05 AM
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha September 20, 2011 5:41 AM
RE: Prevent SessionMessages "Your request processed successfully." Ranga Rao Bobbili September 20, 2011 5:02 AM
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha September 20, 2011 5:42 AM
RE: Prevent SessionMessages "Your request processed successfully." Jelmer Kuperus September 20, 2011 5:48 AM
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha September 20, 2011 5:55 AM
RE: Prevent SessionMessages "Your request processed successfully." Jelmer Kuperus September 20, 2011 6:01 AM
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha September 20, 2011 6:02 AM
RE: Prevent SessionMessages "Your request processed successfully." Anh Lee February 24, 2013 7:02 PM
RE: Prevent SessionMessages "Your request processed successfully." fabian fernandez September 16, 2014 2:33 PM
Corné Aussems
Prevent SessionMessages "Your request processed successfully."
September 14, 2010 5:53 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1311

Join Date: October 3, 2006

Recent Posts

I like to keep my jsp free from code (as much as possible considering liferays ui taglibs)

So far so good no problems here; emoticon

I have a ADD button declared with a actionUrl;
1<a href="<portlet:actionURL name="addNew" />"><liferay-ui:message    key="add" /></a


Using annotations i do my thing in the portlets addNew method; no hrams here

But every time i hit the(any) action url i get the message "Your request processed successfully." displayed

When i look into the SessionMessages object in the addNew methode thers no message at all;
SessionMessages.clear() doesn't help either;

Why is this message always set en how should i prevent it from displaying ?


BTW im using
LR 605
com.liferay.util.bridges.mvc.MVCPortlet
Nagendra Kumar Busam
RE: Prevent SessionMessages "Your request processed successfully."
September 14, 2010 8:37 AM
Answer

Nagendra Kumar Busam

Rank: Liferay Master

Posts: 653

Join Date: July 7, 2009

Recent Posts

Hi Corne,

Did you tried clearing SessionMessages in render method?

I hope portlet_messages.jspf is the file which used to display these messages

Regards,
- Nagendra KUmar
Amos Fong
RE: Prevent SessionMessages "Your request processed successfully."
September 14, 2010 9:58 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1896

Join Date: October 7, 2008

Recent Posts

Hi,

There's a couple options. To always not show it you add this in portlet.xml

1        <init-param>
2            <name>add-process-action-success-action</name>
3            <value>false</value>
4        </init-param>


or if you want to change to logic say for just one action you can override the method:

 1    protected void addSuccessMessage(
 2        ActionRequest actionRequest, ActionResponse actionResponse) {
 3
 4        if (!addProcessActionSuccessMessage) {
 5            return;
 6        }
 7
 8        String successMessage = ParamUtil.getString(
 9            actionRequest, "successMessage");
10
11        SessionMessages.add(actionRequest, "request_processed", successMessage);
12    }
Corné Aussems
RE: Prevent SessionMessages "Your request processed successfully."
September 15, 2010 2:06 PM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1311

Join Date: October 3, 2006

Recent Posts

Thanks for sharing Amos
Sandeep Nair
RE: Prevent SessionMessages "Your request processed successfully."
November 28, 2010 9:36 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

Hi Amos,

Thanks for the solution. One query i had is, i normally use annotation based process action, so what should i do to hide the messages from certain annotation based processAction.

I didnot quite actually understand the second method of overriding the method.

Regards,
Sandeep
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
September 19, 2011 7:00 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Hi Corne and Sandip,

As per the 2 options given by Corne, I tried the first one but thats not reflecting.

I am doing it Liferay Login Portlet.

Can you please point out where I must be getting wrong.

Regards,

Nilesh
Sandeep Nair
RE: Prevent SessionMessages "Your request processed successfully."
September 19, 2011 9:36 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

Which version of liferay are you using. It will work if you are using GenericPortlet.
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
September 19, 2011 9:58 PM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Thanks for the reply Sandip.

I am using Liferay 6.0.6 CE. And I want to disable the SessionMessage "Your request processed successfully." for the Liferay Login portlet.

So I tried the first option given by Corne by modifying the portlet-custom.xml, but that didnt help.

Can you please tell me how can I override addSuccessMessage() method for login portlet.

Thanks and Regards,

Nilesh
Sandeep Nair
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 1:05 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

Hi Neelesh,

It should work. Please debug the source code. Check for LiferayPortlet class which StrutsPortlet uses, there is an init method in which the variable is read. Debug there and see, if it is set to false or not

Regards,
Sandeep
Ranga Rao Bobbili
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 5:02 AM
Answer

Ranga Rao Bobbili

Rank: Regular Member

Posts: 152

Join Date: July 20, 2007

Recent Posts

One more solution, but i will remove message for all other operations. Create hook for html\common\themes\ portlet_messages.jspf.
Remove following content from portlet_messages.jspf.

<c:if test='<%= SessionMessages.contains(renderRequest, "request_processed") %>'>
<div class="portlet-msg-success">

<%
String successMessage = (String)SessionMessages.get(renderRequest, "request_processed");
%>

<c:choose>
<c:when test='<%= Validator.isNotNull(successMessage) && !successMessage.equals("request_processed") %>'>
<%= successMessage %>
</c:when>
<c:otherwise>
<liferay-ui:message key="your-request-processed-successfully" />
</c:otherwise>
</c:choose>
</div>
</c:if>
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 5:41 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Hi Sandeep,

I tried from login.jsp checking the output for

1GetterUtil.getBoolean(getInitParameter("add-process-action-success-action"), true)

This always returned true for me irrespective of whether I set true or false in portlet-custom.xml.

But when I tried this -
1GetterUtil.getBoolean(getPortletConfig().getInitParameter("add-process-action-success-action"), true)

Then this is returning me the correct expected value.


As I navigated thru the LR Source, I found that LR is using the
1GetterUtil.getBoolean(getInitParameter("add-process-action-success-action"), true)

which always returns true.

So if this is true, does this mean this is the bug in Liferay?

Regards,
Nilesh.
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 5:42 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Hi Ranga Rao,

Many Thanks for the help.

But I want to make it for only one portlet, that is Login Portlet.

Regards,
Nilesh.
Jelmer Kuperus
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 5:48 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

add-process-action-success-action wont work for any of the built in portlets. Its a setting used on portlets that extend from LiferayPortlet / MvcPortlet

For me the login portlet never shows the success message btw. When i log in it just shows "You are signed in as x"
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 5:55 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

jelmer kuperus:
add-process-action-success-action wont work for any of the built in portlets. Its a setting used on portlets that extend from LiferayPortlet / MvcPortlet

For me the login portlet never shows the success message btw. When i log in it just shows "You are signed in as x"


Hi Jelmer,

Thanks for reply. I really didnt have any idea that add-process-action-success-action don't work for Built-in portlets.

I get the Success message in login portlet when I do the "Forgot Password". I wanted to disable it.

Thanks,

Nilesh.
Jelmer Kuperus
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 6:01 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

The only thing you can do is extend ForgotPasswordAction in ext and override addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) to do nothing

There is no configuration option that lets you disable the message
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
September 20, 2011 6:02 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Yeah. Thank you very much for all the support.
Anh Lee
RE: Prevent SessionMessages "Your request processed successfully."
February 24, 2013 7:02 PM
Answer

Anh Lee

Rank: New Member

Posts: 4

Join Date: February 24, 2013

Recent Posts

Thank for share Amos
fabian fernandez
RE: Prevent SessionMessages "Your request processed successfully."
September 16, 2014 2:33 PM
Answer

fabian fernandez

Rank: New Member

Posts: 5

Join Date: September 19, 2012

Recent Posts

entonces, simplemente colocando:

addProcessActionSuccessMessage = false;

se logra el objetivo sin necesidad de reescribir el método.

muy útil!!!