本文介绍了如何解决修改相同jsp的钩子之间的冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经从liferay下载了Notifications portlet,该portlet修改了JSP:

We have downloaded the Notifications portlet from liferay which modifies the JSP:

html/portlet/dockbar/view_user_account.jspf

而且我们还在钩子中修改此特定的jspf.

And we are also modifying this particular jspf in our hook.

当前,我们正在从自定义挂钩中的通知portlet复制代码,并在最后部署自定义挂钩,以便应用更改.

Currently what we are doing is we are copying the code from notifications portlet in our custom hook and are deploying our custom hook at the end so that our changes are applied.

否则,我们将需要通过修改通知Portlet的源从通知Portlet中删除JSP钩子.

Or else we would need to remove the JSP hook from notifications portlet by modifying the notification portlet's source.

有没有更好的方法来实现这一目标?

Are there any better ways to achieve this?

谢谢

推荐答案

不幸的是,您陷入了困境.您需要修改其中一个插件以不包含JSP. Liferay最多可以处理每个JSP一次.

Unfortunately you're stuck between a rock and a hard place. You'll need to modify one of the plugins to not contain the JSP. Liferay can handle each JSP to be overridden max once.

另一种选择是在页面显示后通过JS DOM操作入侵"您的更改.这使维护变得更加困难,但简化了日常业务和更新.

An alternative might be to "hack" your changes through JS DOM manipulation after the page is displayed. This makes maintenance harder, but eases daily business and updates.

涉及两个插件更改同一JSP的任何变通办法的最大问题是未定义顺序.而且,它可能具有破坏性:在部署并取消部署了两个修改同一JSP的插件之后,原始的JSP消失了:(

The big problem with any workarounds that involve two plugins changing the same JSP is that order is not defined. Also, it can be destructive: After deploying and undeploying two plugins that modify the same JSP, the original JSP is gone :(

先部署插件A,然后再部署B,然后再取消部署A,则只部署了插件B,但使用的是A版本的被覆盖的JSP.

Deploying plugin A, then B, followed by undeployment of A will leave you with only plugin B deployed, but use A's version of the overridden JSP.

这篇关于如何解决修改相同jsp的钩子之间的冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 15:28