Foros de discusión

First portlet problem : actionURL always redirect to view.jsp

Owen James, modificado hace 12 años.

First portlet problem : actionURL always redirect to view.jsp

New Member Mensajes: 3 Fecha de incorporación: 27/09/11 Mensajes recientes
Hi !

I'm a new Liferay developer and i start with the portlet sample in the Liferay's Developer 6 Guide.

The sample is about dealing with a greeting message which can be edited in a edit.jsp file and displayed in a view.jsp. In the edit.jsp i have a portlet:actionURL which is the action of a form.

When the edit form is updated, there is a success message displayed using liferay-ui:success.

When i submit the form, i'm always redirected to the view.jsp with the greeting message updated ! I don't have the same behavior like in the Guide.

Anyone have an idea ?

Thanks in advance,
thumbnail
Sandeep Nair, modificado hace 12 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Liferay Legend Mensajes: 1744 Fecha de incorporación: 6/11/08 Mensajes recientes
Can you attach your portlet zip file.

Regards,
Sandeep
Owen James, modificado hace 12 años.

RE: First portlet problem : actionURL always redirect to view.jsp

New Member Mensajes: 3 Fecha de incorporación: 27/09/11 Mensajes recientes
Sandeep Nair:
Can you attach your portlet zip file.

Regards,
Sandeep


Hi !

Please, find attached a zip containing the eclipse project.

Thanks in advance.
thumbnail
Sandeep Nair, modificado hace 12 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Liferay Legend Mensajes: 1744 Fecha de incorporación: 6/11/08 Mensajes recientes
Hi Owen,

I downloaded the zip and extracted it, but there is nothing in it except .project, .classpath and build.xml

Regards,
Sandeep
thumbnail
Samir Gami, modificado hace 12 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Regular Member Mensajes: 162 Fecha de incorporación: 4/02/11 Mensajes recientes
Have you change the <portlet-class> to point your own class in portlet.xml ?
thumbnail
Gaurav K Barot, modificado hace 12 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Junior Member Mensajes: 44 Fecha de incorporación: 28/11/08 Mensajes recientes
Owen James:
!

I'm a new Liferay developer and i start with the portlet sample in the Liferay's Developer 6 Guide.

The sample is about dealing with a greeting message which can be edited in a edit.jsp file and displayed in a view.jsp. In the edit.jsp i have a portlet:actionURL which is the action of a form.

When the edit form is updated, there is a success message displayed using liferay-ui:success.

When i submit the form, i'm always redirected to the view.jsp with the greeting message updated ! I don't have the same behavior like in the Guide.

Anyone have an idea ?

Thanks in advance,


Hi Owen,

When you generate actionURL in the edit.jsp it sends the control to processAction (actionReq, actionRes) method of the portlet class. Can you check if you have used dispatcher to dispatch the control to view? If you set the portlet mode to VIEW from processAction( ) then it may go to doView() method and the dispatcher will dispatch it to view.jsp based on the init params you have set in your portlet.xml file.

- Gaurav
thumbnail
Jose Miguel Loor, modificado hace 10 años.

RE: First portlet problem : actionURL always redirect to view.jsp

New Member Mensajes: 11 Fecha de incorporación: 27/11/13 Mensajes recientes
I am having the same problem

How did you solve it ?
thumbnail
Sagar A Vyas, modificado hace 10 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Liferay Master Mensajes: 679 Fecha de incorporación: 17/04/09 Mensajes recientes
Jose,

Give me you portlet jsp file where you are trying to redirect it ? or Portlet zip file.

Thanks,
Sagar Vyas
thumbnail
meera prince, modificado hace 10 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
Hi

In portlet default view is always view.jsp because that will be configured in your portlet.xml file as init parameter


When ever we perform action using action url after completing action then it will render view,jsp page.

Here in the portlet action method we need use response.setRenderParameter("jspPage","html/edit.jsp") then after submit the form again it will render edit.jsp page.

Have a look into folloing article for more information it will help you more.
http://www.liferaysavvy.com/2014/04/jsr-168-standards-portlet-development.html

Regards,
meera price
thumbnail
Marco Azzalini, modificado hace 7 años.

RE: First portlet problem : actionURL always redirect to view.jsp

Regular Member Mensajes: 146 Fecha de incorporación: 18/11/14 Mensajes recientes
Meera Prince:
Hi
Here in the portlet action method we need use response.setRenderParameter("jspPage","html/edit.jsp") then after submit the form again it will render edit.jsp page.


I add this note just to help someone else... the Meera's suggestion is correct (as usual) but the jsp path has to be absolute, not relative, so it should be: /html/edit.jsp.
Using relative path I was getting always this error:
is not a valid include
and it took me a while before I figure out where was the problem emoticon

regards,
Marco