Foren

First portlet problem : actionURL always redirect to view.jsp

Owen James, geändert vor 12 Jahren.

First portlet problem : actionURL always redirect to view.jsp

New Member Beiträge: 3 Beitrittsdatum: 27.09.11 Neueste Beiträge
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, geändert vor 12 Jahren.

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

Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Can you attach your portlet zip file.

Regards,
Sandeep
Owen James, geändert vor 12 Jahren.

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

New Member Beiträge: 3 Beitrittsdatum: 27.09.11 Neueste Beiträge
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, geändert vor 12 Jahren.

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

Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
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, geändert vor 12 Jahren.

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

Regular Member Beiträge: 162 Beitrittsdatum: 04.02.11 Neueste Beiträge
Have you change the <portlet-class> to point your own class in portlet.xml ?
thumbnail
Gaurav K Barot, geändert vor 12 Jahren.

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

Junior Member Beiträge: 44 Beitrittsdatum: 28.11.08 Neueste Beiträge
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, geändert vor 10 Jahren.

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

New Member Beiträge: 11 Beitrittsdatum: 27.11.13 Neueste Beiträge
I am having the same problem

How did you solve it ?
thumbnail
Sagar A Vyas, geändert vor 9 Jahren.

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

Liferay Master Beiträge: 679 Beitrittsdatum: 17.04.09 Neueste Beiträge
Jose,

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

Thanks,
Sagar Vyas
thumbnail
meera prince, geändert vor 9 Jahren.

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

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
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, geändert vor 7 Jahren.

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

Regular Member Beiträge: 146 Beitrittsdatum: 18.11.14 Neueste Beiträge
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