Fórumok

Terms of use hook example - Does not update jsp

Miguel Martinez, módosítva 9 év-val korábban

Terms of use hook example - Does not update jsp

New Member Bejegyzések: 2 Csatlakozás dátuma: 2015.04.10. Legújabb bejegyzések
Hi all,

I was creating my first hook following the documentation steps:

https://www.liferay.com/es/documentation/liferay-portal/6.2/development/-/ai/overriding-web-resources-with-hook-liferay-portal-6-2-dev-guide-en
In the last part it says:
Now there are two Terms of Use JSP files in the liferay-portal-[version]/tomcat-[tomcat-version]/webapps/ROOT/html/portal directory. One is called terms_of_use.jsp and another terms_of_use.portal.jsp. terms_of_use.jsp is your hook’s version, while terms_of_use.portal.jsp is the original. To revert back to the original, undeploy your hook. Your replacement JSP is removed, and the .portal.jsp file is automatically renamed, taking its place. You can override any JSP in the Liferay core, while retaining thew ability to easily revert your changes. However, it’s not possible to override the same JSP from multiple hooks; Liferay won’t know which version to use.

My problem is my modified jsp is not copied in the /ROOT/html/portal folder. There is only the original one. I have tried with several examples and it is the same. I have to update directly the original files and that is not a "hook philosophy".

Do you have any idea?

Thanks!
thumbnail
Olaf Kock, módosítva 9 év-val korábban

RE: Terms of use hook example - Does not update jsp

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
Does the log file say that the hook was deployed? Please check this - if it complains about something and the hook is not deployed, there's no use in checking the code in the hook.

That being said: Is your hook available somewhere to be able to look at it? Can you make it available?
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: Terms of use hook example - Does not update jsp

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
To add what Olaf says, does the path to your file in your hook match that of the portal?
thumbnail
Nilesh Gundecha, módosítva 9 év-val korábban

RE: Terms of use hook example - Does not update jsp

Regular Member Bejegyzések: 205 Csatlakozás dátuma: 2009.12.01. Legújabb bejegyzések
Over and above what Olaf and David said, do also check if your liferay-hook.xml file contains <custom-jsp-dir> tag, which will look something like this -

<custom-jsp-dir>/custom_jsps</custom-jsp-dir>


Regards,
Nilesh
Miguel Martinez, módosítva 9 év-val korábban

RE: Terms of use hook example - Does not update jsp

New Member Bejegyzések: 2 Csatlakozás dátuma: 2015.04.10. Legújabb bejegyzések
Thanks to all for your quick responses.

When I modify the jsp I can see in the console the deploying reload.:

-------------------------
INFO: Ha comenzado la recarga de Contexto [/Ejemplos-Hook-hook]
15:43:38,268 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1016] Reading plugin package for Ejemplos-Hook-hook
16-abr-2015 15:43:40 org.apache.catalina.core.StandardContext reload
INFO: Se ha completado la recarga de este Contexto
15:43:43,980 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][HookExplodedTomcatListener:54] Modifying hook for C:\Liferay\deploy\Ejemplos-Hook-hook.xml
15:43:45,065 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2389] Modifying Servlet 2.5 C:\Liferay\tomcat-7.0.42\webapps\Ejemplos-Hook-hook\WEB-INF\web.xml
15:43:45,066 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][HookExplodedTomcatListener:60] Hook for C:\Liferay\deploy\Ejemplos-Hook-hook.xml modified successfully
15:43:45,066 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseExplodedTomcatListener:49] Copying file C:\Liferay\deploy\Ejemplos-Hook-hook.xml to C:\Liferay\tomcat-7.0.42\conf\Catalina\localhost
----------------------------

The liferay-hook.xml is correctly parametrized:

<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd">

<hook>
<custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>
</hook>



Maybe some eclipse configuration?

Thanks.