留言板

"Your request failed to complete."

thumbnail
Richard Gibson,修改在12 年前。

"Your request failed to complete."

Junior Member 帖子: 30 加入日期: 10-2-19 最近的帖子
Does anyone know of a way to turn off the standard
"Your request failed to complete." message when the SessionErrors object is not empty?
I've added the following init parameters:

        
<init-param>
    <name>add-process-action-success-action</name>
    <value>false</value>
</init-param> 


I was hoping there would be a setting something like 'add-process-action-failure-action' but there doesn't seem to be.

Thanks
Rob Hall,修改在11 年前。

RE: "Your request failed to complete."

Junior Member 帖子: 47 加入日期: 11-11-30 最近的帖子
I have also been looking for a solution for this. We tried CSS, but it had negative side affects. Adding hooks for pre- and post- login events doesn't help, those don't seem to be invoked in an login failure scenario. I've been looking to see if there is a portal property I can set to suppress this message, but haven't found anything.
thumbnail
Jay Patel,修改在11 年前。

RE: "Your request failed to complete."

Regular Member 帖子: 118 加入日期: 10-2-24 最近的帖子
Rob Hall:
I have also been looking for a solution for this. We tried CSS, but it had negative side affects. Adding hooks for pre- and post- login events doesn't help, those don't seem to be invoked in an login failure scenario. I've been looking to see if there is a portal property I can set to suppress this message, but haven't found anything.


Hook for Pre & Post Login only invoked when before & after successful login. It is not invoked at all for failed login. Try using "servlet.service.events.pre" in hook, which will be invoked every time any action is called. In hook you can create your custom action calls which overrides "com.liferay.portal.kernel.events.Action" class of Liferay.

-Jay.
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: "Your request failed to complete."

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Have you checked the following lps?

http://issues.liferay.com/browse/LPS-23008
thumbnail
Ben Carson,修改在11 年前。

RE: "Your request failed to complete."

Junior Member 帖子: 25 加入日期: 12-1-9 最近的帖子
Hitoshi Ozawa:
Have you checked the following lps?

http://issues.liferay.com/browse/LPS-23008


@Hitoshi
Thanks for the link. I want to supplement it by mentioning that you can create a PortletConfig object with the following lines of code:

import com.liferay.portal.kernel.util.JavaConstants;

...

PortletConfig portletConfig = (PortletConfig)req.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
SessionMessages.add(req,  portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);


I had to look up how to create this object, so I just wanted to share with others in case they were struggling as well.

Ben
thumbnail
Atin Agarwal,修改在11 年前。

RE: "Your request failed to complete."

Junior Member 帖子: 86 加入日期: 12-2-20 最近的帖子
PortletConfig portletConfig = (PortletConfig)request.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
SessionMessages.add(request, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);

Not working in Custom portlets.
I have tried this in hooks. It Worked perfectly.
However when i have tried this in my Custom portlet's Process Action it didn't worked..I wonder Why??
Any help wud be appreciated.


Regards
Katalina Marcos,修改在11 年前。

RE: "Your request failed to complete."

New Member 发布: 1 加入日期: 12-9-10 最近的帖子
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
thumbnail
sean gildea,修改在10 年前。

RE: "Your request failed to complete."

New Member 帖子: 20 加入日期: 12-12-15 最近的帖子
Here's a solution for those using Portlets and not hooks. Insert this JQuery code at the top of your JSP page to hide that particular DIV. Make sure you have the JQuery library before you include this.

<script>$(".portlet-msg-error:contains('Your request failed to complete.')").hide();</script>
dfgdfg dfgdfg,修改在9 年前。

RE: "Your request failed to complete."

New Member 发布: 1 加入日期: 14-1-10 最近的帖子
Thank you!
Hu Jun,修改在10 年前。

RE: "Your request failed to complete."

New Member 帖子: 2 加入日期: 12-4-20 最近的帖子
From my point of view, you could write a hook to overwrite portlet_messages.jspf file and remove related code

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

or the bottom of common error information.
thumbnail
Andrew Jardine,修改在7 年前。

RE: "Your request failed to complete."

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
I know that this is an old thread, but just incase anyone comes along, I thought I might share how I am solving this. I got tired of writing a hook to remove code. Typically, I create my own base Portlet class for my projects -- and that base portlet extends the MVCPortlet. All the custom portlets that I create extend from y base Portlet class that I have defined which means that during processing I can have common render functions in the base Portlet. In this case I always want to suppress the default failure message for all my custom portlets so in the base Portlet class for my solution I do the following --

    @Override
    public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException
    {
        try
        {
            long companyId = PortalUtil.getCompanyId(renderRequest);

            com.liferay.portal.model.Portlet portlet = PortletLocalServiceUtil.getPortletById(companyId, "YOUR PORTLET ID HERE");

            SessionMessages.add(request, portlet.getPortletId() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
        }
        catch( Exception e )
        {
            // ignore exception
        }

        super.render(request, response);
    }


and voila! If you wanted to make it optional per portlet, you could also use the same model that Liferay has by adding this init parameter --


        <init-param>
            <name>add-process-action-general-error-action</name>
            <value>false</value>
        </init-param>


and then using the portlet object, get the init params and check for it. I don't need that -- for the moment anyway so I am just forcing all error to be scrapped. Just thought i'd share