Fórum

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

Kiran Jai, modificado 12 Anos atrás.

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

Junior Member Postagens: 38 Data de Entrada: 09/04/12 Postagens Recentes
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 .
ruchi sharma, modificado 12 Anos atrás.

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

Junior Member Postagens: 95 Data de Entrada: 24/03/11 Postagens Recentes
Hi,
Could you please show your login code.
After looking at the code, may be i can help you.

Thanks
Ruchi
Kiran Jai, modificado 12 Anos atrás.

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

Junior Member Postagens: 38 Data de Entrada: 09/04/12 Postagens Recentes
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
Dhrutika Parekh, modificado 12 Anos atrás.

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

Expert Postagens: 435 Data de Entrada: 09/02/09 Postagens Recentes
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
ruchi sharma, modificado 12 Anos atrás.

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

Junior Member Postagens: 95 Data de Entrada: 24/03/11 Postagens Recentes
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