Foros de discusión
Liferay 6: Unable to redirect to JSP from MVCPortlet
Ravi Kiran, modificado hace 12 años.
Liferay 6: Unable to redirect to JSP from MVCPortlet
Junior Member Mensajes: 53 Fecha de incorporación: 8/04/12 Mensajes recientes
Depending upon a condition i want to redirect to a JSP Page from my MVCPortlet class , after setting <action-url-redirect> to true in liferay-portlet.xml, i tried with actionResponse.sendRedirect then i got this Error under Server console
Set render parameter has already been called
Then i tried uisng
`include("/html/satportlet/view2.jsp", request, response);` , now there is no exception but nothing is happening in this case , dont know why .
An another question i assume that in Liferay also the concept of include and sendRedirect is same as of that in JSP and Servlets ??
I am using Liferay 6
Set render parameter has already been called
Then i tried uisng
`include("/html/satportlet/view2.jsp", request, response);` , now there is no exception but nothing is happening in this case , dont know why .
An another question i assume that in Liferay also the concept of include and sendRedirect is same as of that in JSP and Servlets ??
I am using Liferay 6
Hitoshi Ozawa, modificado hace 12 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Try
in your jsp:
<input type="hidden" name="redirect" value="<%= PortalUtil.getCurrentURL(renderRequest) %>">
in your class:
public void processAction(ActionRequest request, ActionResponse response) {
sendRedirect(request, response);
}
in your jsp:
<input type="hidden" name="redirect" value="<%= PortalUtil.getCurrentURL(renderRequest) %>">
in your class:
public void processAction(ActionRequest request, ActionResponse response) {
sendRedirect(request, response);
}
Ravi Kiran, modificado hace 12 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
Junior Member Mensajes: 53 Fecha de incorporación: 8/04/12 Mensajes recientesHitoshi Ozawa:
Try
in your jsp:
<input type="hidden" name="redirect" value="<%= PortalUtil.getCurrentURL(renderRequest) %>">
in your class:
public void processAction(ActionRequest request, ActionResponse response) {
sendRedirect(request, response);
}
Hi , Thanks for the response , you have just mentioned to use
sendRedirect(request, response);
Where should i mention this path "/html/satportlet/view2.jsp" (Which is the actual jsp it must be redirected to )
Please tell me if i am missing something .Thanks
Ajeykumar HB, modificado hace 12 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
Junior Member Mensajes: 72 Fecha de incorporación: 13/03/12 Mensajes recientes
Hi Ravi Kiran,
You can use the below line of code to redirect to other JSP page through action class, in the below code replace "/ack.jsp" with the path of your jsp page, where you need to redirect.
response.setRenderParameter("jspPage","/ack.jsp");
You can use the below line of code to redirect to other JSP page through action class, in the below code replace "/ack.jsp" with the path of your jsp page, where you need to redirect.
response.setRenderParameter("jspPage","/ack.jsp");
Ravi Kiran, modificado hace 12 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
Junior Member Mensajes: 53 Fecha de incorporación: 8/04/12 Mensajes recientes
This one worked perfectly , Thank you , without doing any chnages in JSP .
Sohi Mankotia, modificado hace 11 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
New Member Mensajes: 13 Fecha de incorporación: 6/07/12 Mensajes recientes
hi.....I want to navigate to new liferay portlet page by clicking on a link in jasp page through action method of mvc. how to do that???
Prakash Khanchandani, modificado hace 11 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
Expert Mensajes: 329 Fecha de incorporación: 10/02/11 Mensajes recientesSohi Mankotia:
hi.....I want to navigate to new liferay portlet page by clicking on a link in jasp page through action method of mvc. how to do that???
Please don't hijack other people's post. Please create a separate post with your question. Thanks.
Rajesh Chaurasia, modificado hace 11 años.
RE: Liferay 6: Unable to redirect to JSP from MVCPortlet
Regular Member Mensajes: 183 Fecha de incorporación: 18/08/11 Mensajes recientes
yuo can do this by using following:
getPortletContext().getRequestDispatcher(response.encodeURL(Constants.PATH_TO_JSP_PAGE + jspPage)).include(request, response);
getPortletContext().getRequestDispatcher(response.encodeURL(Constants.PATH_TO_JSP_PAGE + jspPage)).include(request, response);