掲示板

Couldn't able to show default landing page from Portlet Action class

12年前 に Kiran Jai によって更新されました。

Couldn't able to show default landing page from Portlet Action class

Junior Member 投稿: 38 参加年月日: 12/04/09 最新の投稿
Hi ,

I am using Liferay 6 Portal for develoment .
I have created a page (Be it any page Public or private page ) , and added some of my developed Custom Portlets to it and i defined this page as a default landing page .

Now inside my GenericPortlet class , once the users validates his username and password with our database , i want to redirect him to my landing page .

I have tried a lot used Portlets RequestDispatcher's forward , include also , with the combinations of absolute and relative path to my default landing page .
And also tried my luck with using ActionResponse from processAction Method .

But neither thing has worked , could anybody please tell me how to resolve this issue ??

If anyone knows please help me how to resolve this issue .

Thanks you very much for reading .
12年前 に ruchi sharma によって更新されました。

RE: Couldn't able to show default landing page from Portlet Action class

Junior Member 投稿: 95 参加年月日: 11/03/24 最新の投稿
Hi,
Could you please show your login code.
After looking at the code, may be i can help you.

Thanks
Ruchi
12年前 に Kiran Jai によって更新されました。

RE: Couldn't able to show default landing page from Portlet Action class

Junior Member 投稿: 38 参加年月日: 12/04/09 最新の投稿
ruchi sharma:
Hi,
Could you please show your login code.
After looking at the code, may be i can help you.

Thanks
Ruchi



There is nothing much in the code , anyway for the reference

Earlier i tried using Actionresponse from processAction method using ActionResponse.sendRedirect("http://localhost:8086/user/test/home ")

commented that and using this way , also tried with this way
http://localhost:8086/user/test/home and /user/test/home

public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {

response.setContentType("text/html");


PortletRequestDispatcher dispatcher = null;
if (this.name.isEmpty()) {
dispatcher = getPortletContext().getRequestDispatcher(
"/WEB-INF/jsp/AllInOne_view.jsp");
} else {

dispatcher = getPortletContext().getRequestDispatcher(
"http://localhost:8086/user/test/home");
}

dispatcher.include(request, response);
}

And with this there is this exception

17:53:47,765 ERROR [render_portlet_jsp:154] java.lang.NullPointerException
at org.ravi.learning.AllInOne.doView(AllInOne.java:57)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

The AllinOne.java is my Custom GenericPortlet class AllInOne.java:57 is

dispatcher.include(request, response);

Please let me know if anything needs to be changed . thanks in advance .
thumbnail
12年前 に Dhrutika Parekh によって更新されました。

RE: Couldn't able to show default landing page from Portlet Action class

Expert 投稿: 435 参加年月日: 09/02/09 最新の投稿
Hi,

Overwrite DefaultLandingPageAction class using hook to achieve your requirement,

You can refer to this links for more info: http://www.liferay.com/community/wiki/-/wiki/Main/Customizing+the+default+page+after+login

Regards,
Dhrutika
12年前 に ruchi sharma によって更新されました。

RE: Couldn't able to show default landing page from Portlet Action class

Junior Member 投稿: 95 参加年月日: 11/03/24 最新の投稿
Hello ,
As Dhrutika said, hooks can be used for login events that is one of the best option.
Are you able to go to AllInOne_view.jsp when login fails ??
Regards
Ruchi