掲示板

First portlet problem : actionURL always redirect to view.jsp

12年前 に Owen James によって更新されました。

First portlet problem : actionURL always redirect to view.jsp

New Member 投稿: 3 参加年月日: 11/09/27 最新の投稿
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
12年前 に Sandeep Nair によって更新されました。

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

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Can you attach your portlet zip file.

Regards,
Sandeep
12年前 に Owen James によって更新されました。

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

New Member 投稿: 3 参加年月日: 11/09/27 最新の投稿
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
12年前 に Sandeep Nair によって更新されました。

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

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi Owen,

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

Regards,
Sandeep
thumbnail
12年前 に Samir Gami によって更新されました。

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

Regular Member 投稿: 162 参加年月日: 11/02/04 最新の投稿
Have you change the <portlet-class> to point your own class in portlet.xml ?
thumbnail
12年前 に Gaurav K Barot によって更新されました。

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

Junior Member 投稿: 44 参加年月日: 08/11/28 最新の投稿
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
9年前 に Jose Miguel Loor によって更新されました。

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

New Member 投稿: 11 参加年月日: 13/11/27 最新の投稿
I am having the same problem

How did you solve it ?
thumbnail
9年前 に Sagar A Vyas によって更新されました。

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

Liferay Master 投稿: 679 参加年月日: 09/04/17 最新の投稿
Jose,

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

Thanks,
Sagar Vyas
thumbnail
9年前 に meera prince によって更新されました。

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

Liferay Legend 投稿: 1111 参加年月日: 11/02/08 最新の投稿
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
7年前 に Marco Azzalini によって更新されました。

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

Regular Member 投稿: 146 参加年月日: 14/11/18 最新の投稿
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