Fórum

First portlet problem : actionURL always redirect to view.jsp

Owen James, modificado 12 Anos atrás.

First portlet problem : actionURL always redirect to view.jsp

New Member Postagens: 3 Data de Entrada: 27/09/11 Postagens Recentes
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 12 Anos atrás.

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

Liferay Legend Postagens: 1744 Data de Entrada: 06/11/08 Postagens Recentes
Can you attach your portlet zip file.

Regards,
Sandeep
Owen James, modificado 12 Anos atrás.

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

New Member Postagens: 3 Data de Entrada: 27/09/11 Postagens Recentes
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 12 Anos atrás.

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

Liferay Legend Postagens: 1744 Data de Entrada: 06/11/08 Postagens Recentes
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 12 Anos atrás.

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

Regular Member Postagens: 162 Data de Entrada: 04/02/11 Postagens Recentes
Have you change the <portlet-class> to point your own class in portlet.xml ?
thumbnail
Gaurav K Barot, modificado 12 Anos atrás.

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

Junior Member Postagens: 44 Data de Entrada: 28/11/08 Postagens Recentes
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 10 Anos atrás.

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

New Member Postagens: 11 Data de Entrada: 27/11/13 Postagens Recentes
I am having the same problem

How did you solve it ?
thumbnail
Sagar A Vyas, modificado 10 Anos atrás.

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

Liferay Master Postagens: 679 Data de Entrada: 17/04/09 Postagens Recentes
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 9 Anos atrás.

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

Liferay Legend Postagens: 1111 Data de Entrada: 08/02/11 Postagens Recentes
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 7 Anos atrás.

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

Regular Member Postagens: 146 Data de Entrada: 18/11/14 Postagens Recentes
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