Liferay JSP Hook
Liferay JSP hooks are used to override JSP, java script, images etc.Lets create a simple jsp hook that override login.jsp from Liferay core JSP’s.
All web resource Hook configuration will in in custom-jsp-dir in liferay-hook.xml file like below:
<hook>
<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
</hook>
- create hook plugin : In IDE, File -> New -> Liferay Plugin Project and select plugin type as Hook.
- In eclipse, login-hook is created. right click on the project and select New -> File -> Liferay Hook Configuration
- In this wizard, we can add the JSP’s file to override.
- Now it will create below project structure and add custom jsp entry to liferay-hook.xml file
- liferay-hook.xml file
-
<hook> <custom-jsp-dir>/custom_jsps</custom-jsp-dir> </hook>
-
- liferay-hook.xml file
- Edit the login.jsp and deploy the login hook
- After deploying, It will rename the original login.jsp to login.jsp.portal and this new file will be loaded in the browser.
[…] Liferay JSP Hook,Liferay Hook tutorial,Liferay login hook […]
[…] Liferay JSP Hook,Liferay Hook tutorial,Liferay login hook […]
[…] Liferay JSP Hook,Liferay Hook tutorial,Liferay login hook […]