0

I saw here some questions with the same topic as mine, but they are quite old. Is there maybe nowadays a working solution? Something that makes an automatic merge of the two hooks and wont destroy the default jsp?

For people who dont know what my problem is. When you deploy two hooks on the same .jsp file, the original jsp is being deleted. And im looking for a solution which makes an merge of the two hooks and the original wont be deleted.

Thanks

arfis
  • 113
  • 1
  • 5
  • 1
    Please refer blog:https://web.liferay.com/web/olaf.kock/blog/-/blogs/overriding-jsps-from-multiple-hooks-promising-the-cure . Also, its better to use one hook so you don't face issue of overriding same file twice – Pankaj Kathiriya Apr 21 '16 at 18:53
  • I saw this article but it is just an error when an hook already exists. And of course it is better to use one hook but when we work on a bigger project (more people) it sometimes happens that people dont communicate and they hook a jsp which is already hooked. But thanks for the reply appreciate it. I was just curious if an auto mergeing system for hooks exists :) – arfis Apr 22 '16 at 06:51

1 Answers1

1

There's no concept of automatically merging two different JSPs - it would only work in few cases and leave others open to the same problem.

The code that Pankajkumar Kathiriya links in the comment (my blog article) solves this problem by denying the deployment of the second hook. You'll then have to merge/resolve the conflict yourself.

Some version of Liferay (maybe the latest 6.2 CE GA) implements it as well - the blog article links to the issue. Note that Liferay's own implementation doesn't give you the full logging information that my implementation gives you, but it works. There's also an extension that also includes duplicate overridden struts actions.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • Thanks Olaf for the answer. I just wanted to know the current state in which liferay is. If there maybe isnt an automergeing system in the newer version (6.2 CE GA5). Appreciate it – arfis Apr 22 '16 at 06:56
  • There's no automerging in 6.2. And JSP Hooks should be largely a thing of the past with Liferay 7 anyway. – Olaf Kock Apr 22 '16 at 06:59