Forums de discussion
Prevent SessionMessages "Your request processed successfully."
Corné Aussems, modifié il y a 13 années.
Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
I like to keep my jsp free from code (as much as possible considering liferays ui taglibs)
So far so good no problems here;
I have a ADD button declared with a actionUrl;
So far so good no problems here;
I have a ADD button declared with a actionUrl;
<a href="<portlet:actionURL name=" addNew"></a>"><liferay-ui:message key="add" />
<br><br>Using annotations i do my thing in the portlets addNew method; no hrams here<br><br>But every time i hit the(any) action url i get the message "Your request processed successfully." displayed <br><br>When i look into the SessionMessages object in the addNew methode thers no message at all;<br>SessionMessages.clear() doesn't help either;<br><br>Why is this message always set en how should i prevent it from displaying ?<br><br><br>BTW im using <br>LR 605<br>com.liferay.util.bridges.mvc.MVCPortlet
Nagendra Kumar Busam, modifié il y a 13 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Master Publications: 678 Date d'inscription: 07/07/09 Publications récentes
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
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, modifié il y a 13 années.
RE: Prevent SessionMessages "Your request processed successfully." (Réponse)
Liferay Legend Publications: 2047 Date d'inscription: 07/10/08 Publications récentes
Hi,
There's a couple options. To always not show it you add this in portlet.xml
or if you want to change to logic say for just one action you can override the method:
There's a couple options. To always not show it you add this in portlet.xml
<init-param>
<name>add-process-action-success-action</name>
<value>false</value>
</init-param>
or if you want to change to logic say for just one action you can override the method:
protected void addSuccessMessage(
ActionRequest actionRequest, ActionResponse actionResponse) {
if (!addProcessActionSuccessMessage) {
return;
}
String successMessage = ParamUtil.getString(
actionRequest, "successMessage");
SessionMessages.add(actionRequest, "request_processed", successMessage);
}
Corné Aussems, modifié il y a 13 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
Thanks for sharing Amos
Sandeep Nair, modifié il y a 13 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 Publications récentes
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
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, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 205 Date d'inscription: 01/12/09 Publications récentes
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
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, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 Publications récentes
Which version of liferay are you using. It will work if you are using GenericPortlet.
Nilesh Gundecha, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 205 Date d'inscription: 01/12/09 Publications récentes
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
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, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 Publications récentes
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
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
Nilesh Gundecha, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 205 Date d'inscription: 01/12/09 Publications récentes
Hi Sandeep,
I tried from login.jsp checking the output for
This always returned true for me irrespective of whether I set true or false in portlet-custom.xml.
But when I tried this -
Then this is returning me the correct expected value.
As I navigated thru the LR Source, I found that LR is using the
which always returns true.
So if this is true, does this mean this is the bug in Liferay?
Regards,
Nilesh.
I tried from login.jsp checking the output for
GetterUtil.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 -
GetterUtil.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
GetterUtil.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.
Ranga Rao Bobbili, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 152 Date d'inscription: 20/07/07 Publications récentes
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>
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, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 205 Date d'inscription: 01/12/09 Publications récentes
Hi Ranga Rao,
Many Thanks for the help.
But I want to make it for only one portlet, that is Login Portlet.
Regards,
Nilesh.
Many Thanks for the help.
But I want to make it for only one portlet, that is Login Portlet.
Regards,
Nilesh.
jelmer kuperus, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1191 Date d'inscription: 10/03/10 Publications récentes
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"
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, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 205 Date d'inscription: 01/12/09 Publications récentesjelmer 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, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Liferay Legend Publications: 1191 Date d'inscription: 10/03/10 Publications récentes
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
There is no configuration option that lets you disable the message
Nilesh Gundecha, modifié il y a 12 années.
RE: Prevent SessionMessages "Your request processed successfully."
Regular Member Publications: 205 Date d'inscription: 01/12/09 Publications récentes
Yeah. Thank you very much for all the support.
Anh Lee, modifié il y a 11 années.
RE: Prevent SessionMessages "Your request processed successfully."
New Member Publications: 4 Date d'inscription: 25/02/13 Publications récentes
Thank for share Amos
fabian fernandez, modifié il y a 9 années.
RE: Prevent SessionMessages "Your request processed successfully."
New Member Publications: 5 Date d'inscription: 19/09/12 Publications récentes
entonces, simplemente colocando:
addProcessActionSuccessMessage = false;
se logra el objetivo sin necesidad de reescribir el método.
muy útil!!!
addProcessActionSuccessMessage = false;
se logra el objetivo sin necesidad de reescribir el método.
muy útil!!!