フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Prevent SessionMessages "Your request processed successfully." Corné Aussems 2010/09/14 5:53
RE: Prevent SessionMessages "Your request processed successfully." Nagendra Kumar Busam 2010/09/14 8:37
RE: Prevent SessionMessages "Your request processed successfully." Amos Fong 2010/09/14 9:58
RE: Prevent SessionMessages "Your request processed successfully." Corné Aussems 2010/09/15 14:06
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair 2010/11/28 9:36
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 2011/09/19 7:00
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair 2011/09/19 21:36
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 2011/09/19 21:58
RE: Prevent SessionMessages "Your request processed successfully." Sandeep Nair 2011/09/20 1:05
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 2011/09/20 5:41
RE: Prevent SessionMessages "Your request processed successfully." Ranga Rao Bobbili 2011/09/20 5:02
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 2011/09/20 5:42
RE: Prevent SessionMessages "Your request processed successfully." Jelmer Kuperus 2011/09/20 5:48
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 2011/09/20 5:55
RE: Prevent SessionMessages "Your request processed successfully." Jelmer Kuperus 2011/09/20 6:01
RE: Prevent SessionMessages "Your request processed successfully." Nilesh Gundecha 2011/09/20 6:02
RE: Prevent SessionMessages "Your request processed successfully." Anh Lee 2013/02/24 19:02
RE: Prevent SessionMessages "Your request processed successfully." fabian fernandez 2014/09/16 14:33
Corné Aussems
Prevent SessionMessages "Your request processed successfully."
2010/09/14 5:53
答え

Corné Aussems

ランク: Liferay Legend

投稿: 1270

参加年月日: 2006/10/03

最近の投稿

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."
2010/09/14 8:37
答え

Nagendra Kumar Busam

ランク: Liferay Master

投稿: 637

参加年月日: 2009/07/07

最近の投稿

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."
2010/09/14 9:58
答え

Amos Fong

LIFERAY STAFF

ランク: Liferay Legend

投稿: 1844

参加年月日: 2008/10/07

最近の投稿

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."
2010/09/15 14:06
答え

Corné Aussems

ランク: Liferay Legend

投稿: 1270

参加年月日: 2006/10/03

最近の投稿

Thanks for sharing Amos
Sandeep Nair
RE: Prevent SessionMessages "Your request processed successfully."
2010/11/28 9:36
答え

Sandeep Nair

ランク: Liferay Legend

投稿: 1692

参加年月日: 2008/11/05

最近の投稿

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."
2011/09/19 7:00
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 189

参加年月日: 2009/11/30

最近の投稿

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."
2011/09/19 21:36
答え

Sandeep Nair

ランク: Liferay Legend

投稿: 1692

参加年月日: 2008/11/05

最近の投稿

Which version of liferay are you using. It will work if you are using GenericPortlet.
Nilesh Gundecha
RE: Prevent SessionMessages "Your request processed successfully."
2011/09/19 21:58
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 189

参加年月日: 2009/11/30

最近の投稿

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."
2011/09/20 1:05
答え

Sandeep Nair

ランク: Liferay Legend

投稿: 1692

参加年月日: 2008/11/05

最近の投稿

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."
2011/09/20 5:02
答え

Ranga Rao Bobbili

ランク: Regular Member

投稿: 148

参加年月日: 2007/07/20

最近の投稿

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."
2011/09/20 5:41
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 189

参加年月日: 2009/11/30

最近の投稿

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."
2011/09/20 5:42
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 189

参加年月日: 2009/11/30

最近の投稿

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."
2011/09/20 5:48
答え

Jelmer Kuperus

ランク: Liferay Legend

投稿: 1192

参加年月日: 2010/03/10

最近の投稿

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."
2011/09/20 5:55
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 189

参加年月日: 2009/11/30

最近の投稿

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."
2011/09/20 6:01
答え

Jelmer Kuperus

ランク: Liferay Legend

投稿: 1192

参加年月日: 2010/03/10

最近の投稿

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."
2011/09/20 6:02
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 189

参加年月日: 2009/11/30

最近の投稿

Yeah. Thank you very much for all the support.
Anh Lee
RE: Prevent SessionMessages "Your request processed successfully."
2013/02/24 19:02
答え

Anh Lee

ランク: New Member

投稿: 4

参加年月日: 2013/02/24

最近の投稿

Thank for share Amos
fabian fernandez
RE: Prevent SessionMessages "Your request processed successfully."
2014/09/16 14:33
答え

fabian fernandez

ランク: New Member

投稿: 1

参加年月日: 2012/09/19

最近の投稿

entonces, simplemente colocando:

addProcessActionSuccessMessage = false;

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

muy útil!!!