Foren

Overriding struts actions and jsp for version 6.0.6

Patrick Blais, geändert vor 9 Jahren.

Overriding struts actions and jsp for version 6.0.6

New Member Beiträge: 4 Beitrittsdatum: 24.07.14 Neueste Beiträge
I have checked all the documentation in order to override a jsp and a liferay struts action class.

Here is the steps I did:

1) I have a hook project with the following :
I created a new jsp file called password.jsp in docroot/web-inf/jsps/portlet/enterprise_admin/user

2) created a new action class that extends EditUserAction in my liferay hook project.

3) created a new struts-config and overrid all the action paths containing EditUserAction
<action path="/admin_server/edit_user" type="com.liferay.portlet.enterpriseadmin.action.EditUserAction">
			<forward name="portlet.enterprise_admin.edit_user" path="portlet.directory.view_user" />
			<forward name="portlet.enterprise_admin.error" path="portlet.directory.error" />
</action>


by this

<action path="/admin_server/edit_user" type="my.hook.project.liferay.RPMEditLiferayUserAction">
			<forward name="portlet.enterprise_admin.edit_user" path="portlet.directory.view_user" />
			<forward name="portlet.enterprise_admin.error" path="portlet.directory.error" />
</action>


the content of my liferay-hook.xml :

<!--?xml version="1.0"?-->


<hook>
	<portal-properties>portal.properties</portal-properties>
	<custom-jsp-dir>/WEB-INF/jsps</custom-jsp-dir>
</hook>


But nothing works.
I have been able to test my code by copying manually my class and jsp but this is not what I want. I would like the overriding to take place.

What Am I missing? The documentation for 6.0.6 doesn't give much apart from the loginAction with pre and post execution set in the properties file....

Please help
thumbnail
Mohammad Danish, geändert vor 9 Jahren.

RE: Overriding struts actions and jsp for version 6.0.6

Regular Member Beiträge: 187 Beitrittsdatum: 05.03.12 Neueste Beiträge
This is not possible if you are using 6.0.6 CE. This flexibility was given in LR 6.1. as give in the official blog
https://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins you can't do that.

This is a new cool feature I worked on with Brian and it’s coming on 6.1 as well as 6.0 EE SP2 and 5.2 EE SP6. With this feature you can add new struts actions to portal from a hook plugin and you can override any existing action with it.