Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Prevent SessionMessages "Your request processed successfully." Corné Aussems 14 settembre 2010 5.53
RE: Prevent SessionMessages "Your request processed successfully." Nagendra Kumar Busam 14 settembre 2010 8.37
RE: Prevent SessionMessages "Your request processed successfully." Amos Fong 14 settembre 2010 9.58
RE: Prevent SessionMessages "Your request processed successfully." Corné Aussems 15 settembre 2010 14.06
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair 28 novembre 2010 9.36
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 19 settembre 2011 7.00
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair 19 settembre 2011 21.36
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 19 settembre 2011 21.58
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair 20 settembre 2011 1.05
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 20 settembre 2011 5.41
RE: Prevent SessionMessages "Your request processed successfully." Ranga Rao Bobbili 20 settembre 2011 5.02
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 20 settembre 2011 5.42
RE: Prevent SessionMessages "Your request processed successfully." Jelmer Kuperus 20 settembre 2011 5.48
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 20 settembre 2011 5.55
RE: Prevent SessionMessages "Your request processed successfully." Jelmer Kuperus 20 settembre 2011 6.01
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 20 settembre 2011 6.02
RE: Prevent SessionMessages "Your request processed successfully." Anh Lee 24 febbraio 2013 19.02
RE: Prevent SessionMessages "Your request processed successfully." fabian fernandez 16 settembre 2014 14.33
Corné Aussems
Prevent SessionMessages "Your request processed successfully."
14 settembre 2010 5.53
Risposta

Corné Aussems

Punteggio: Liferay Legend

Messaggi: 1311

Data di Iscrizione: 3 ottobre 2006

Messaggi recenti

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."
14 settembre 2010 8.37
Risposta

Nagendra Kumar Busam

Punteggio: Liferay Master

Messaggi: 653

Data di Iscrizione: 7 luglio 2009

Messaggi recenti

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."
14 settembre 2010 9.58
Risposta

Amos Fong

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1896

Data di Iscrizione: 7 ottobre 2008

Messaggi recenti

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."
15 settembre 2010 14.06
Risposta

Corné Aussems

Punteggio: Liferay Legend

Messaggi: 1311

Data di Iscrizione: 3 ottobre 2006

Messaggi recenti

Thanks for sharing Amos
Sandeep Nair
RE: Prevent SessionMessages "Your request processed successfully."
28 novembre 2010 9.36
Risposta

Sandeep Nair

Punteggio: Liferay Legend

Messaggi: 1721

Data di Iscrizione: 5 novembre 2008

Messaggi recenti

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."
19 settembre 2011 7.00
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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."
19 settembre 2011 21.36
Risposta

Sandeep Nair

Punteggio: Liferay Legend

Messaggi: 1721

Data di Iscrizione: 5 novembre 2008

Messaggi recenti

Which version of liferay are you using. It will work if you are using GenericPortlet.
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
19 settembre 2011 21.58
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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."
20 settembre 2011 1.05
Risposta

Sandeep Nair

Punteggio: Liferay Legend

Messaggi: 1721

Data di Iscrizione: 5 novembre 2008

Messaggi recenti

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."
20 settembre 2011 5.02
Risposta

Ranga Rao Bobbili

Punteggio: Regular Member

Messaggi: 152

Data di Iscrizione: 20 luglio 2007

Messaggi recenti

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."
20 settembre 2011 5.41
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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."
20 settembre 2011 5.42
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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."
20 settembre 2011 5.48
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1192

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

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."
20 settembre 2011 5.55
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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."
20 settembre 2011 6.01
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1192

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

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."
20 settembre 2011 6.02
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

Yeah. Thank you very much for all the support.
Anh Lee
RE: Prevent SessionMessages "Your request processed successfully."
24 febbraio 2013 19.02
Risposta

Anh Lee

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 24 febbraio 2013

Messaggi recenti

Thank for share Amos
fabian fernandez
RE: Prevent SessionMessages "Your request processed successfully."
16 settembre 2014 14.33
Risposta

fabian fernandez

Punteggio: New Member

Messaggi: 5

Data di Iscrizione: 19 settembre 2012

Messaggi recenti

entonces, simplemente colocando:

addProcessActionSuccessMessage = false;

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

muy útil!!!