Message Boards

Issue with redirection : Response.sendRedirect not redirecting to RENDER

Prathibha h m, modified 3 Years ago.

Issue with redirection : Response.sendRedirect not redirecting to RENDER

Junior Member Posts: 74 Join Date: 9/17/09 Recent Posts
Page 1 (/abc -  in the same site) - ABC portlet - /view.jsp want to redirect to Page 2  ( /receipt-notice  - in the same site) -  ABC portlet - /receipt.jsp
In Render command ,  if (receipt) {
                return "/receiptPage.jsp";
        }
In Action Command,   long plid = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getScopeGroupId(),
                            true, "/receipt-notice").getPlid();
   PortletURL ReceiptURL = PortletURLFactoryUtil.create(actionRequest, "ABCPortlet",plid, PortletRequest.RENDER_PHASE);
     uploadReceiptURL.setParameter("redirect", _portal.getCurrentURL(actionRequest));
       uploadReceiptURL.setParameter("mvcPath", "/receiptPage.jsp");
 
      actionResponse.sendRedirect(ReceiptURL.toString());

-----------------------------------------------------------------It redirects to receiptPage.jsp sometimes but failing most of the times. I am not able to understand the reason behind this sporadic behaviour.Please let me know if I have missed to set any params?   also do I have to set  p_p_id  , p_p_lifecycle,  p_p_state    Regards,Prathibha
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Issue with redirection : Response.sendRedirect not redirecting to REN

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi ,
Can u pls share the url that is getting generating from the above code also the what error your getting .
Please check the difference in url which is loading correctly and the one failing , In case both are same you can check the log for any error .