Fórum

"Your request failed to complete."

thumbnail
Richard Gibson, modificado 12 Anos atrás.

"Your request failed to complete."

Junior Member Postagens: 30 Data de Entrada: 19/02/10 Postagens Recentes
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, modificado 11 Anos atrás.

RE: "Your request failed to complete."

Junior Member Postagens: 47 Data de Entrada: 30/11/11 Postagens Recentes
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, modificado 11 Anos atrás.

RE: "Your request failed to complete."

Regular Member Postagens: 118 Data de Entrada: 24/02/10 Postagens Recentes
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, modificado 11 Anos atrás.

RE: "Your request failed to complete."

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Have you checked the following lps?

http://issues.liferay.com/browse/LPS-23008
thumbnail
Ben Carson, modificado 11 Anos atrás.

RE: "Your request failed to complete."

Junior Member Postagens: 25 Data de Entrada: 09/01/12 Postagens Recentes
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, modificado 11 Anos atrás.

RE: "Your request failed to complete."

Junior Member Postagens: 86 Data de Entrada: 20/02/12 Postagens Recentes
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, modificado 11 Anos atrás.

RE: "Your request failed to complete."

New Member Mensagem: 1 Data de Entrada: 10/09/12 Postagens Recentes
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
thumbnail
sean gildea, modificado 10 Anos atrás.

RE: "Your request failed to complete."

New Member Postagens: 20 Data de Entrada: 15/12/12 Postagens Recentes
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, modificado 9 Anos atrás.

RE: "Your request failed to complete."

New Member Mensagem: 1 Data de Entrada: 10/01/14 Postagens Recentes
Thank you!
Hu Jun, modificado 10 Anos atrás.

RE: "Your request failed to complete."

New Member Postagens: 2 Data de Entrada: 20/04/12 Postagens Recentes
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, modificado 7 Anos atrás.

RE: "Your request failed to complete."

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
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