Fórum
Overiding LoginAction
Bill Gosse, modificado 12 Anos atrás.
Overiding LoginAction
Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
I want overide com.liferay.portlet.login.action.LoginAction as part of an extension project I have.
I'm not sure how to designate my custom class in the portal.properties file. Is this possible?
Actually I just wound up replacing the LoginAction with one that had the additional code that I needed, instead of extending it with a custom child class.
I'm not sure how to designate my custom class in the portal.properties file. Is this possible?
Actually I just wound up replacing the LoginAction with one that had the additional code that I needed, instead of extending it with a custom child class.
Amos Fong, modificado 12 Anos atrás.
RE: Overiding LoginAction
Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Hi Bill,
You have two options. You can use ext and override just that struts action in struts-config-ext.xml.
http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/creating-an-ext-plugin
Or create an hook:
http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115
You have two options. You can use ext and override just that struts action in struts-config-ext.xml.
http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/creating-an-ext-plugin
Or create an hook:
http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115
Emilio José Lamas Fraga, modificado 11 Anos atrás.
RE: Overiding LoginAction
Junior Member Postagens: 57 Data de Entrada: 29/11/11 Postagens Recentes
Hi Amos,
I don't know how to create a hook in the way Mika suggests for LoginAction; when I try to deploy, it throws a ClassNotFoundException because of the PortalAction that LoginAction extends.
I think this is because LoginAction belongs to portal-impl and it's not in the kernel package - like, for example, BaseStrutsAction -, so maybe in this case it's only possible to override LoginAction through EXT Plugin.
Am I Right? o I just making a mistake developing the hook?
Thanks!
I don't know how to create a hook in the way Mika suggests for LoginAction; when I try to deploy, it throws a ClassNotFoundException because of the PortalAction that LoginAction extends.
I think this is because LoginAction belongs to portal-impl and it's not in the kernel package - like, for example, BaseStrutsAction -, so maybe in this case it's only possible to override LoginAction through EXT Plugin.
Am I Right? o I just making a mistake developing the hook?
Thanks!
Srikanth Konjarla, modificado 11 Anos atrás.
RE: Overiding LoginAction
Junior Member Postagens: 51 Data de Entrada: 25/10/08 Postagens Recentes
A sample to extend struts action might help.
http://svn.liferay.com/repos/public/plugins/trunk/hooks/sample-struts-action-hook/
http://svn.liferay.com/repos/public/plugins/trunk/hooks/sample-struts-action-hook/
Emilio José Lamas Fraga, modificado 11 Anos atrás.
RE: Overiding LoginAction
Junior Member Postagens: 57 Data de Entrada: 29/11/11 Postagens Recentes
Hi Srikanth,
I've already try that example and it works fine. My problem is overriding the LoginAction class.
LoginAction extends com.liferay.portal.struts.PortletAction, and, when I try to deploy my ext plugin, it throws an exception because that class is not found.
Regards.
I've already try that example and it works fine. My problem is overriding the LoginAction class.
LoginAction extends com.liferay.portal.struts.PortletAction, and, when I try to deploy my ext plugin, it throws an exception because that class is not found.
Regards.
Matthew Stevenson, modificado 11 Anos atrás.
RE: Overiding LoginAction
New Member Postagens: 12 Data de Entrada: 17/05/12 Postagens Recentes
Same issue experienced when trying to extend OpenIdAction in a hook:
Am using Liferay 6.1EE
Caused by: java.lang.ClassNotFoundException: com.liferay.portlet.login.action.OpenIdAction
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
... 31 more
Am using Liferay 6.1EE
Janus Godard, modificado 10 Anos atrás.
RE: Overiding LoginAction
New Member Postagens: 17 Data de Entrada: 01/08/13 Postagens RecentesEmilio Jose Lamas Fraga:
Hi Srikanth,
I've already try that example and it works fine. My problem is overriding the LoginAction class.
LoginAction extends com.liferay.portal.struts.PortletAction, and, when I try to deploy my ext plugin, it throws an exception because that class is not found.
Regards.
Did you ever find a solution to that problem?
I'm having the same problem.
I'm working on adding captcha to the sign in page, as per:
https://www.liferay.com/community/forums/-/message_boards/message/11428960
The hook content is:
<hook>
<custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>
<struts-action>
<struts-action-path>/login/login</struts-action-path>
<struts-action-impl>com.janus.portal.hook.login.captcha.CaptchaLoginAction</struts-action-impl>
</struts-action>
</hook>
The class is CaptchaLoginAction extends com.liferay.portlet.login.action.LoginAction
The error is:
13:40:28,064 ERROR [pool-2-thread-56][HotDeployImpl:191] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for captcha-login-hook
[...]
Caused by: java.lang.ClassNotFoundException: com.liferay.portlet.login.action.LoginAction
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
Jose A. Jiménez, modificado 10 Anos atrás.
RE: Overiding LoginAction
Regular Member Postagens: 176 Data de Entrada: 23/08/12 Postagens Recentes
Hi Janus,
The LoginAction is under the portal classloader, just in portal-impl that is unavalaible from the hook classloader: https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portlet/login/action/LoginAction.java
In a hook you only can add/replace actions but not including portal-impl dependencies.
I hope this helps you.
Jose
The LoginAction is under the portal classloader, just in portal-impl that is unavalaible from the hook classloader: https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portlet/login/action/LoginAction.java
In a hook you only can add/replace actions but not including portal-impl dependencies.
I hope this helps you.
Jose