Fórum
Overriding Struts Action using hook
Krishnabalaji Ramalingam, modificado 11 Anos atrás.
Overriding Struts Action using hook
New Member Postagens: 7 Data de Entrada: 19/05/12 Postagens Recentes
Hello,
Version : Liferay EE 6.0 SP2
Business case: Override the terms of use according to the login user role
I am trying to override the UpdateTermsOfUseAction class using liferay hook as per the blogs : http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115
But I am getting ClassCastException
liferay-hook.xml
UpdateTermsOfUseAction.java
As per the message board http://www.liferay.com/community/forums/-/message_boards/message/13487363, Prefer EXT plugin.
Could you please update us to achieve this implementation using hook ?
Thanks in Advance
Regards,
R.Krishnabalaji
Version : Liferay EE 6.0 SP2
Business case: Override the terms of use according to the login user role
I am trying to override the UpdateTermsOfUseAction class using liferay hook as per the blogs : http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115
But I am getting ClassCastException
liferay-hook.xml
<!--?xml version="1.0" encoding="UTF-8"?-->
<hook>
<portal-properties>portal.properties</portal-properties>
<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
<struts-action>
<struts-action-path>/portal/update_terms_of_use</struts-action-path>
<struts-action-impl>com.liferay.portal.hook.action.UpdateTermsOfUseAction</struts-action-impl>
</struts-action>
</hook>
UpdateTermsOfUseAction.java
public class UpdateTermsOfUseAction extends BaseStrutsAction {... }
As per the message board http://www.liferay.com/community/forums/-/message_boards/message/13487363, Prefer EXT plugin.
Could you please update us to achieve this implementation using hook ?
Thanks in Advance
Regards,
R.Krishnabalaji
Jitendra Rajput, modificado 11 Anos atrás.
RE: Overriding Struts Action using hook
Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Could you please try by extending BaseStrutsPortletAction instead of BaseStrutsAction ..
Krishnabalaji Ramalingam, modificado 11 Anos atrás.
RE: Overriding Struts Action using hook
New Member Postagens: 7 Data de Entrada: 19/05/12 Postagens Recentes
Hi,
Thank you for your response
I am getting the exception, as mentioned in the below link
http://www.liferay.com/community/forums/-/message_boards/message/13487363,
Regards,
R.Krishnabalaji
Thank you for your response
I am getting the exception, as mentioned in the below link
http://www.liferay.com/community/forums/-/message_boards/message/13487363,
Regards,
R.Krishnabalaji
Krishnabalaji Ramalingam, modificado 11 Anos atrás.
RE: Overriding Struts Action using hook (Resposta)
New Member Postagens: 7 Data de Entrada: 19/05/12 Postagens Recentes
Hi All,
Thank you for your response.
I have implemented my business case in hook itself. I did a mistake. In my previous code I have used the below snippet
Answer :
We need to use execute(HttpServletRequest request, HttpServletResponse response) or
execute(StrutsAction originalStrutsAction, HttpServletRequest request, HttpServletResponse response)
Please let me know if you need further information.
Thanks,
R.Krishnabalaji
Thank you for your response.
I have implemented my business case in hook itself. I did a mistake. In my previous code I have used the below snippet
public class UpdateTermsOfUseAction extends BaseStrutsAction {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception { .. }
}
Answer :
We need to use execute(HttpServletRequest request, HttpServletResponse response) or
execute(StrutsAction originalStrutsAction, HttpServletRequest request, HttpServletResponse response)
public class UpdateTermsOfUseAction extends BaseStrutsAction {
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {...}
}
Please let me know if you need further information.
Thanks,
R.Krishnabalaji
Hashim Raza, modificado 11 Anos atrás.
RE: Overriding Struts Action using hook
New Member Postagens: 14 Data de Entrada: 26/06/12 Postagens Recentes
Hi Krishnabalaji,
Can you please post your exception stack trace? First few lines will do. Thanks.
Regards,
Hashim
Can you please post your exception stack trace? First few lines will do. Thanks.
Regards,
Hashim
Amit Doshi, modificado 11 Anos atrás.
RE: Overriding Struts Action using hook
Liferay Master Postagens: 550 Data de Entrada: 29/12/10 Postagens Recentes
Hi Krishnabalaji,
Please check below link, which will be helpful for creating struts action Hook in liferay.
http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115
Thanks & Regards,
Amit Doshi
Please check below link, which will be helpful for creating struts action Hook in liferay.
http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115
Thanks & Regards,
Amit Doshi